Page 1 of 1

Using strings as X axis reference with DBTeechart

Posted: Tue Feb 06, 2007 9:15 pm
by 9244030
Using DBTeeChart 7.08, I have to generate a chart that represents Total Sales per Magazine issue. The problem is that the issues are represented by strings, example 'Vol 1, no. 1', 'Vol 1, no. 2', the 'Special issue 3', etc...

My query retrieves records in the proper order. How can I design the chart to have the issue string in the X axis?

PS. I am using the chart inside ReportBuilder 10.5.

Thanks

Salim

Posted: Wed Feb 07, 2007 12:07 pm
by narcis
Hi Salim,

You could assign the issues strings as Labels, and total sales per issue as Values. That way, the chart will automatically add sequential x values (0, 1, 2, ...) but labels will be displayed in the bottom axis.

Posted: Wed Feb 07, 2007 12:35 pm
by 9244030
This is great, I thought that the X values in series were mandatory.

Thanks and Best Regards

Salim

Posted: Wed Feb 07, 2007 12:45 pm
by narcis
Hi Salim,

You're very welcome! I'm glad to hear this helped.

No, mandatory values are Y values. If no X values are provided TeeChart automatically adds them.

Posted: Fri Mar 02, 2007 4:34 am
by 8120110
Hi, I did what you said but I have to face a new problem: the marks are automatically setting to the label's value:

And this is my code:

FastLine fl1 = new FastLine();
fl1.YValues.DataMember = ds.Tables[0].Columns[1].ToString();
fl1.LabelMember = ds.Tables[0].Columns[0].ToString();
fl1.DataSource = ds.Tables[0];
fl1.Marks.Visible = true;
///////////////////////////////////////////////

Plz help me.

Posted: Fri Mar 02, 2007 8:10 am
by narcis
Hi Dautm,

You can set marks to display values like this:

Code: Select all

  Series1.Marks.Style := smsValue;

Posted: Fri Mar 02, 2007 4:59 pm
by 8120110
Thank you so much. I put: fl1.Marks.Style=MarksStyles.Value; and it worked :D .

One more question please, I need to know how to modify the left axis scale because the default scale for my data (values between 0-70), is 10, so I see the following labels: 0,10,20...70 and I want for example to change the scale to 35 and see only 0,35,70.

Thx in advanced!!

Posted: Fri Mar 02, 2007 5:02 pm
by narcis
Hi Dautm,

You're welcome.

To achieve what you request you need to set left axis increment:

Code: Select all

  Chart1.Axes.Left.Increment:=75;
More information on how to work with axes is available in Tutorial 4 - Axis Control. You'll find the tutorials at TeeChart's program group.

Posted: Fri Mar 02, 2007 6:15 pm
by 8120110
Thx so much again. I have just read that tutorial and it was useful to solve other issues about Axes but now I have a Mark issue. How can I set the format to my Marks because I need to show 4 decimals and the default is only 3 decimals

Thx in advanced.

Posted: Mon Mar 12, 2007 9:27 am
by Pep
Hi Dautm,

you can format the value using :
Series1.ValueFormat := '###,###,###.###';