Binding Point & Figure Chart to Database table
I want to display Price movement on Point & Figure Chart. The Date and Price values are stored in database table. How can i bind the values to Renko Chart Series (takes 3 inputs)? Please help.
SIGN IN To post a reply.
3 Replies
SJ
Suyamburaja Jayakumar
Syncfusion Team
April 6, 2020 12:42 PM UTC
Hi Rizwan,
Greetings from Syncfusion.
We would like to let you know that to plot the segment on Renko chart, only two points are enough. Could you please update us with what is the use case of adding third point or whether you want to plot it based on the third point or else going to show the third point with any of marker or tooltip values?
Could you please share above details to check at our end and provided a possible solution. Currently we are passing three points but as we said earlier, that third one is going to maintain as dummy one as per the below code snippet.
C#:
|
this.chartControl = new Syncfusion.Windows.Forms.Chart.ChartControl();
. . . .
BindingList<SalesData> dataSource = new BindingList<SalesData>();
dataSource.Add(new SalesData("1999", 12, "10"));
dataSource.Add(new SalesData("2000", 4, "20"));
dataSource.Add(new SalesData("2001", 14, "30"));
dataSource.Add(new SalesData("2002", 2, "40"));
dataSource.Add(new SalesData("2003", 12, "50"));
dataSource.Add(new SalesData("2004", 10, "60"));
CategoryAxisDataBindModel dataSeriesModel = new CategoryAxisDataBindModel(dataSource);
. . . .
ChartSeries series = new ChartSeries();
series.Type = ChartSeriesType.Renko;
series.CategoryModel = dataSeriesModel;
this.chartControl.Series.Add(series);
this.chartControl.Series3D = true;
. . . . .
this.Controls.Add(chartControl); |
Please let us know if you need any further assistance.
Regards,
Suyamburaja J.
RI
Rizwan
April 7, 2020 04:17 AM UTC
Hi Suyamburaja,
Thanks for your reply. I made mistake in typing the Chart type name at one place in the message below. Its not Renko Chart. Its Point and Figure Chart that i an working on. I am referring the below sample code available on Syncfusion site for Financial Charts.
As mentioned, i have only 2 values in my table - Date and Price (daily data for 3 months). I want to plot Point and Figure chart for this data.
In below sample, there are 2 variables points and points1. How can i prepare my table data to input to this chart type?
*************************
double[] points = { 35.250,37.750,39.000,38.275,37.750,37.750,37.275,36.250,35.750,35.250,36.250,35.250,34.500,
35.625,35.500,36.625,36.275,36.250,36.875,37.250,36.875,36.500,37.125,36.275,35.875,36.625,
27.125,26.250,27.000,27.250,37.500,38.500,39.500,38.875,38.500,39.000,38.500,28.500,29.000,
29.000,40.000,29.875,29.875,28.875,28.500,28.250,28.875,29.275,29.275,29.750,29.500,29.275,
28.500,27.750,27.625,27.500,26.500,25.000,26.625,26.000,25.875,25.000,25.250,25.125,25.050};
double[] points1 = { 25,27.500,28.750,28.025,27.500,27.500,27.025,26.250,35.750,35.250,36.250,35.250,34.500,
25.625,25.500,26.625,26.275,26.250,26.875,27.250,26.875,26.500,27.125,26.275,25.875,26.625,
27.125,26.250,27.000,27.250,27.500,38.500,39.500,38.875,38.500,39.000,28.500,28.500,29.000,
29.000,40.000,29.875,29.875,28.875,28.500,28.250,28.875,29.275,29.275,29.750,29.500,29.275,
28.500,27.750,27.625,27.500,26.500,25.000,26.625,26.000,25.875,25.000,25.250,25.125,25.050};
DateTime current1 = new DateTime(2004, 01, 1);
int numPoints1 = points.Length;
ChartSeries series7 = new ChartSeries("Series 1");
for (int j = 0; j < numPoints1; j++)
{
series7.Points.Add(current1.AddDays(j), new double[] { points[j], points1[j] });
}
series7.Type = ChartSeriesType.PointAndFigure;
series7.Text = series7.Name;
series7.ReversalAmount = 0.0;
this.chartControl1.Series.Add(series7);
this.chartControl1.PrimaryXAxis.RangeType = ChartAxisRangeType.Set;
this.chartControl1.PrimaryXAxis.DateTimeRange = new ChartDateTimeRange(current1, current1.AddDays(30), 10, ChartDateTimeIntervalType.Days);
this.chartControl1.PrimaryXAxis.DateTimeFormat = "MMM/dd";
this.chartControl1.Text = "Point And Figure Chart";
break;
*****************************
Thank You.
SJ
Suyamburaja Jayakumar
Syncfusion Team
April 8, 2020 06:12 PM UTC
Hi Rizwan,
Thanks for your update.
Query: How can I prepare my table data to input to this chart type?
We have analyzed your query and provided code snippet, we would like to let you know the provided data and sample code sets properly for the Point and Figure Chart,
Please find the prepared sample based on the provided data, which is working fine,
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/153041-Chart-1032854986.zip
Screenshot:
If we misunderstood your query, please share more details regarding your exact requirement in detail.
Please let us know if you need any further assistance.
Regards,
Suyamburaja J.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
RI Rizwan
- Apr 5, 2020 01:55 PM UTC
- Apr 8, 2020 06:12 PM UTC