Stacked Column Chart

V3ngeanc3V3ngeanc3 Centurion
edited 4:51AM in FastReport .NET
Hi,

I'm struggling to do a stacked column chart with the code behind.

The following code gives me a only 1 value allowed error:

mscDevelopmentMAdv.Series[1].AddValue(dsDevelopmentMAdv.Columns.Alias.Replace("BookP", string.Empty).Replace("Reef", string.Empty).Replace("Waste", string.Empty)
, dsDevelopmentMAdv[dsDevelopmentMAdv.Columns].ToString()
, dsDevelopmentMAdv[dsDevelopmentMAdv.Columns[i+1]].ToString()
);

I then went to the Chart.Series properties in the properties window. Changes it to 2 and it worked, but did not add both values.
And as soon as the report is closed this setting goes back to 1.

There's no where in the user manuals or internet where I can find an example of how a stacked column chart is created with code.

Please help

Comments

  • V3ngeanc3V3ngeanc3 Centurion
    edited 4:51AM
    Isn't there a way to do the code like in C#:

    chart1.Series["Series1"].Points.AddY(random.Next(75, 170));
    chart1.Series["Series2"].Points.AddY(random.Next(35, 125));
    chart1.Series["Series3"].Points.AddY(random.Next(45, 140));
    chart1.Series["Series4"].Points.AddY(random.Next(25, 110));
  • edited 4:51AM
    Hello,

    You should create two series in the designer, then fill it by code:

    mscDevelopmentMAdv.Series[0].AddValue(xValue, yValue);
    mscDevelopmentMAdv.Series[1].AddValue(xValue, yValue);

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.