Fast Report Chart question
Hi all
I'm getting good results with the charting in FR. However I have one small problem. I've used charts before in Delphi and would add values by using :
Chart.SeriesList[j].AddXY(x, y, '', color);
However I can't find the AddXY() Method in the FR TfrxChartView component. So I'm using :
AChartView.SeriesData.YSource
AChartView.SeriesData.XSource
Problem is the chart looks like this:
I'm getting good results with the charting in FR. However I have one small problem. I've used charts before in Delphi and would add values by using :
Chart.SeriesList[j].AddXY(x, y, '', color);
However I can't find the AddXY() Method in the FR TfrxChartView component. So I'm using :
AChartView.SeriesData.YSource
AChartView.SeriesData.XSource
Problem is the chart looks like this:
Comments
Chart1.SeriesData[0].Source1 := 'A;B;C'; //labels
Chart1.SeriesData[0].Source2 := '1;2;3'; //x
Chart1.SeriesData[0].Source3 := '4;5;6';//y
Chart1.SeriesData[0].Source4 := '10;20;30';//offset
Chart1.SeriesData[0].Values5 := 'clred;clyellow;clblue';//color
Sorry no this still makes absolutely no sense to me. Could you possible show me the code to get the last (bottom) graph picture on my first question?
Thanks
A
I'll do that when I get a chance to put together a demo.
In the mean time if you could demonstrate code like :
Chart1.SeriesData[0].Source1 := 'A;B;C'; //labels
Chart1.SeriesData[0].Source2 := '1;2;3'; //x
Chart1.SeriesData[0].Source3 := '4;5;6';//y
Chart1.SeriesData[0].Source4 := '10;20;30';//offset
Chart1.SeriesData[0].Values5 := 'clred;clyellow;clblue';//color
that will produce a chart like the 3rd image in my first question that would be more than enough help to me.
Thanks
// Set Y-axis = 0, 100
// Set X-axis = 0, 30
// First line, blue
TeeChart.SeriesList[0].AddXY(0, 95);
TeeChart.SeriesList[0].AddXY(3, 95);
TeeChart.SeriesList[0].AddXY(9, 5);
TeeChart.SeriesList[0].AddXY(17, 5);
TeeChart.SeriesList[0].AddXY(30, 100);
// Second line
TeeChart.SeriesList[0].AddXY(0, 5);
TeeChart.SeriesList[0].AddXY(3, 5);
TeeChart.SeriesList[0].AddXY(9, 95);
TeeChart.SeriesList[0].AddXY(17, 95);
TeeChart.SeriesList[0].AddXY(30, 0);
A
write code in the obp event of the chartobject.
procedure Chart1OnBeforePrint(Sender: TfrxComponent);
begin
Chart1.AddSeries(csLine);
Chart1.SeriesData[0].DataType := dtFixedData;
Chart1.SeriesData[0].xSource := '0;3;9;17;30';
Chart1.SeriesData[0].ySource := '95;95;5;5;100';
chart1.addseries(csline);
chart1.seriesdata[1].datatype := dtfixeddata;
//Chart1.SeriesData[1].xSource := '0;3;9;17;30';
Chart1.SeriesData[1].ySource := '5;5;95;95;0';
end;
Thanks for the response but I've already got to this point.
The problem is is that the X Axis is non linear. That is the distance between 0 and 3 is the same as between 3 and 9, and again between 9 and 17. I want the X Axis to go in a linear fasion from 0 to 30. So the graph will look like the image I've attached before.
Perhaps here is something else I need to set in the Chart obj to make it so???
Thanks
A
AChartView.SeriesData[0].XType := xtNumber;
I now get the x-axis in a liner fasion:
Adding: AChartView.Chart.BottomAxis.Increment := 5;
Changes the axis to show "0, 5, 10, 15, 20. 25, 30" labels only.
[img]style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> Case closed...[/img]