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:

Created:

Updated:

Platform:

Replies:

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

Hello!

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,
Ramya.


ChartBinding.zip

Alexander
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

untitled33.zip

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.
this.chartControl1.Series.Add(series);

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.
this.chartControl1.Series.Add(series1);
series1.Style.Interior=new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.ForwardDiagonal,Color.Orange,Color.White);
this.chartControl1.PrimaryXAxis.AutoValueType = true;
this.chartControl1.ColumnWidthMode=ChartColumnWidthMode.FixedWidthMode;

Also kindly take a look at the attached sample.

Let me know whether this helps you.

Thanks & Regards,
Ramya.

ChartBinding0.zip

CONFIRMATION

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.

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

;