Sign in to follow this  
Followers 0
chillon

Multi Series Labels

4 posts in this topic

hi,

I have a question about multi series labeling in a line chart. the labels for the axis_x
are numbers instead of the string read from the dataset

This only
happens for multi series ........single series is ok.
Please let me know how i can rectify this. Thanks!

 

Posted Image
 

 

 

Share this post


Link to post
Share on other sites

I'm using ChartFX CS 5.1 for Delphi 6.

 

IN THE MAIN FUNCTION

  /* yvaluesABS : array[1..128] of double; */

  /* sitenames : array[1..15] of string;  */

    /* CfxData: CfxDataArray; */

//assign values to yvaluesABS  and sitenames

//....


  CfxData := CfxDataArray.Create();

  for i := 0 to 14 do
  begin
  for j := 0 to 127 do
  yvaluesABS[j] := /* assign values to yvaluesABS */;
  CfxData.AddArray(yvaluesABS);
  ChartP.Series.Legend := sitenames;
  end;
  ChartP.Title[CHART_TOPTIT] := '....';

  ChartP.Axis[axis_y].ForceZero := false;
  ChartP.Axis[axis_y].AutoScale := true;
  ChartP.Axis[axis_x].STEP := 0;

  ChartP.GetExternalData(CfxData.InterfacePtr,0);

 

AND THEN IN A CLICK EVENT TO CHANGE LABELS OF CHARTP: 

  /*  itv_bandname : array[1..128] of string;  */

  //assign values to itv_bandname

  //...

  for f:= 0 to 127 do
  ChartP.Axis[AXIS_X].Label_[f] := itv_bandname[f];

 

 

 

thanks! 

Share this post


Link to post
Share on other sites

hi chillon,

try this:

 chart1.AxisX.LabelsFormat.Format :=  AxisFormat_Date;

 or this:

Chart1.AxisX.LabelsFormat.CustomFormat = 'MMM/yy'

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0