I am using DataBindTable() to bind a table to a chart. There are several float type columns for Y values and a date type column for the X value of all other columns. But only the first series(i.e. series of index 0) got the right x values, the x values
of other series seems to be set to the same random series that I don't know where it come from. I have also tried to assign each series mannually but got the same result. I have attached my two failed function and the result chart images below, could someone
help me get out of this? Thanks!
chart image(only one series is enable in each image):
But only the first series(i.e. series of index 0) got the right x values, the x values of other series seems to be set to the same random series that I don't know where it come from.
According to your description, I had written a demo on my computer.
I find if I don't set Series.XValueType to ChartValueType.DateTime, it will show the result as image 2 shows.
So I suggest you change your codes and set Series.XValueType to each series.
More details about my test demo, you could refer to follow codes:
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
2 Points
6 Posts
how to use DataBindTable method to populate X-values to mutiple series?
Aug 24, 2016 08:33 AM|Zachary.Chen|LINK
Hello friends,
I am using DataBindTable() to bind a table to a chart. There are several float type columns for Y values and a date type column for the X value of all other columns. But only the first series(i.e. series of index 0) got the right x values, the x values of other series seems to be set to the same random series that I don't know where it come from. I have also tried to assign each series mannually but got the same result. I have attached my two failed function and the result chart images below, could someone help me get out of this? Thanks!
chart image(only one series is enable in each image):
image of first series image of second series
function 1: use DataBindTable()
function 2: set each series mannually
Star
9831 Points
3120 Posts
Re: how to use DataBindTable method to populate X-values to mutiple series?
Aug 25, 2016 02:30 PM|Brando ZWZ|LINK
Hi Zachary.Chen,
According to your description, I had written a demo on my computer.
I find if I don't set Series.XValueType to ChartValueType.DateTime, it will show the result as image 2 shows.
So I suggest you change your codes and set Series.XValueType to each series.
More details about my test demo, you could refer to follow codes:
Chart:
Code-behind:
Best Regards,
Brando
Member
2 Points
6 Posts
Re: how to use DataBindTable method to populate X-values to mutiple series?
Aug 29, 2016 02:43 AM|Zachary.Chen|LINK
Hello Brando ZWZ,
Inspired by your demo, I set XValueType for each series, then everything is fine. Thanks!