We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

using ChartDataBindModel

Thread ID:





55041 Jan 23,2007 10:20 AM UTC Feb 2,2007 01:45 PM UTC WinForms 3
Tags: Chart
Asked On January 23, 2007 10:20 AM UTC


I don't understand some features of ChartDataBindModel.

I have a datasource with two value columns ("value1" and "value2"). When I use the code shown below (with the column type chart):

ChartDataBindModel modelTotal = new ChartDataBindModel(chartData, "ReportData");
modelTotal.XName = "index";
modelTotal.YNames = new string[] { "value1", "value2" };

I see on the chart control that values of columns "value1" and "value2" are collided. That's what I want. But as they have the same color I see the maximum value of "value1" and "value2". Can I set separate colors to this two values???

Ramya R [Syncfusion]
Replied On January 24, 2007 02:42 PM UTC

Hi Alexander,

If your intention is to display two columns on the ChartControl using ChartDataBindModel then it can be done by adding another series to the ChartControl and binding the another value(value 2) to YAxis of another instance of ChartDataBindModel.

Kindly take a look at the attached sample.

Let me know if I am wrong in getting your requirement.

Thanks & Regards,


Replied On January 31, 2007 03:44 PM UTC

Thanx you for answer.

But I need the same behaviour as in the attached file.
When two series is placed in the same point on th X axis


Administrator [Syncfusion]
Replied On February 2, 2007 01:45 PM UTC

Hi Alexander,

Thank You for the update.

You can display the column charts as in image sent by you by creating series with multiple Y-Values and setting the ColumnWidthMode of ChartControl to FixedWidthMode as shown in the code snippet below,

ChartSeries series = this.chartControl1.Model.NewSeries("Products");
for(int i=0;i {
double x=Convert.ToDouble(dataSet.Tables[0].Rows[i]["ID"].ToString());
double y=Convert.ToDouble(dataSet.Tables[0].Rows[i]["ID"].ToString());

series.Points.Add(x,new double[]{y,10});

//Adds the series to the ChartSeriesCollection.

ChartSeries series1 = this.chartControl1.Model.NewSeries("Products");
for(int i=0;i {
double x=Convert.ToDouble(dataSet.Tables[0].Rows[i]["ID"].ToString());
double y=Convert.ToDouble(dataSet.Tables[0].Rows[i]["Population"].ToString());

series1.Points.Add(x,new double[]{y,12});


//Adds the series to the ChartSeriesCollection.
series1.Style.Interior=new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.ForwardDiagonal,Color.Orange,Color.White);
this.chartControl1.PrimaryXAxis.AutoValueType = true;

Also kindly take a look at the attached sample.

Let me know whether this helps you.

Thanks & Regards,



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon