Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
780
Multiple Series rendering question.
posted

If I put 2 simple numeric series on a web chart where the data doesn't quite match up, it doesn't render the way I'd expect. 

ASPX:

<igchart:UltraChart ID="UltraChart1" runat="server" BackgroundImageFileName=""
        BorderColor="Black" BorderWidth="0px" Version="9.1">
    </igchart:UltraChart>


Code Behind:

protected void Page_Load(object sender, EventArgs e)
{
    NumericSeries s1 = new NumericSeries();
    s1.Points.Add(new NumericDataPoint() { Value = 50, Label = "Mark" });
    s1.Points.Add(new NumericDataPoint() { Value = 40, Label = "Sue" });

    NumericSeries s2 = new NumericSeries();
    s2.Points.Add(new NumericDataPoint() { Value = 10, Label = "Mark" });
    s2.Points.Add(new NumericDataPoint() { Value = 23, Label = "Bob" });
    s2.Points.Add(new NumericDataPoint() { Value = 15, Label = "Joe" });


    this.UltraChart1.Series.Add(s1);
    this.UltraChart1.Series.Add(s2);   
}

 

I would expect to see 4 clusters of columns for Mark , Sue, Bob and Joe.  With Mark having data for both series, and the rest only for 1 or the other.

Instead, I get:

Mark, Sue, <BLANK>, Mark, Bob.

So, I get only 2 values of each series written.  Joe is ignored.  And the values aren't clustered by the labels.  Is there a way I can get what I'm looking for?

Parents
  • 17605
    Verified Answer
    posted

    You need to add 4 series. You can try: 

        NumericSeries s1 = new NumericSeries();

            s1.Label = "Mark";

            s1.Points.Add(new NumericDataPoint() { Value = 50, Label = "1" });

            s1.Points.Add(new NumericDataPoint() { Value = 10, Label = "2" });

     

            NumericSeries s2 = new NumericSeries();

            s2.Label = "Bob";       

            s2.Points.Add(new NumericDataPoint() { Value = 23, Label = "1" });

            s2.Points.Add(new NumericDataPoint() { Value = 0, Label = "", Empty=true });

     

            NumericSeries s3 = new NumericSeries();

            s3.Label = "Sue";

            s3.Points.Add(new NumericDataPoint() { Value = 40, Label = "1" });

            s3.Points.Add(new NumericDataPoint() { Value = 0, Label = "", Empty = true });

     

            NumericSeries s4 = new NumericSeries();

            s4.Label = "Joe";

            s4.Points.Add(new NumericDataPoint() { Value = 15, Label = "1" });

            s4.Points.Add(new NumericDataPoint() { Value = 0, Label = "", Empty = true });

     

     

            this.UltraChart1.Series.Add(s1);

            this.UltraChart1.Series.Add(s2);

            this.UltraChart1.Series.Add(s3);

            this.UltraChart1.Series.Add(s4);

     

            this.UltraChart1.Data.ZeroAligned = true;

     

Reply Children
No Data