Frequently Asked Component Specific Questions
Options |
Display all FAQ items |
Displaying items 1 to 1 of 1, page 1 of 1
<< previous next >>
TMS VCL Chart
Adding points to a specific chart pane with a specific chart serie
Adding points to a specific chart pane with a specific chart serie
TAdvChartView
To visualize points the TAdvChartView component must be filled with values. Therefore the method AddSinglePoint adds points to a specific chart pane with a specific chart serie. After adding the points, set the Range of points you want to have visualized in the chart. In the sample below the range is set from 0 to 20 to display all 20 values. Note: Include the AdvChart Unit to use the value arEnabled for the AutoRange property as this type is defined in the unit AdvChart.
Example:
procedure TForm1.AddPoints; var i: integer; begin //Adds 20 Points with random value from 0 to 50 to the first Pane (0) //with the first Serie (0) for i := 0 to 20 do AdvChartView.Panes[0].Series[0].AddSinglePoint(RandomRange(0, 50)); //Set Range from 0 to 20 AdvChartView.Panes[0].Range.RangeFrom := 0; AdvChartView.Panes[0].Range.RangeTo := 20; //Set Auto Display Range to arEnabled AdvChartView.Panes[0].Series[0].Autorange := arEnabled; end;
TAdvChartViewGDIP (GDI +)
To visualize points, use the same method for adding points as for the TAdvChartView component. To use transparency and complex gradients add a TAdvChartViewGDIP component to the form and add the code below. Add Unit AdvChartUtil to the Uses clause. The best way to see the transparency is to add a Background image.
Example:
procedure TForm1.GDIPGraphics; begin //Adds Gradient start color and Gradient end color with a Forward //Diagonal Gradient type. The starting Transparency is 120 and the end //transparency is 255; AdvGDIPChartView.Panes[0].Series[0].Color := clTeal; AdvGDIPChartView.Panes[0].Series[0].ColorTo := clOlive; AdvGDIPChartView.Panes[0].Series[0].Opacity := 120; AdvGDIPChartView.Panes[0].Series[0].Opacity := 255; AdvGDIPChartView.Panes[0].Series[0].GradientType := gtForwardDiagonal; end;