I've been playing with this for the better part of two days and I'm stumped. I have a StackAreaChart where I'm passing a datatable into the chart. The datatable is set up with the following columns:
When I simply set the datasource of this chart to the datatable and swap the columns and rows, I get the StackAreaChart I expect to get. For each department, the y-axis reflects the data in each department's column and the x-axis reflects the StartTime. When hovering over the datapoints I get the location of that point on the chart. The legend contains an entry for each department and follows the colormodel that was set up in the designer just as the chart does. The <ITEM_LABEL> is the department name.
Now, I need to add a line and some special formatting to just 1 of my Areas which means I need to change this from a StackAreaChart to a Composite chart with a StackArea Layer. How would I go about setting the datasource for the StackArea Layer? What type of series should I use? How should I set the value columns?
Thank you
I managed to get this working with the following code.
Dim series As New NumericSeries For i As Integer = 3 To dt.Columns.Count - 1 series = New NumericSeries series.DataBind(dt, dt.Columns(i).ColumnName, "INT_START_TIME") series.Label = dt.Columns(i).ColumnName ugcResults.CompositeChart.ChartLayers(0).Series.Add(series) Next
Now however I'm experiencing a problem with the Legend. The colormodel I'm useing has an AlphaLevel of 150 and this is reflected in the chart as it should. The legend however displays the colors as if the AlphaLevel was 255. Any ideas?
Hello Bryan,
If you are using composite chart, my suggestion is to use also composite legend. For example:
CompositeLegend myLegend = new CompositeLegend();
myLegend.ChartLayers.Add(myScatterLayer);
myLegend.Bounds =new Rectangle(88, 2, 11, 15);
myLegend.BoundsMeasureType =MeasureType.Percentage;
myLegend.PE.ElementType =PaintElementType.Gradient;
myLegend.PE.FillGradientStyle =GradientStyle.ForwardDiagonal;
myLegend.PE.Fill =Color.CornflowerBlue;
myLegend.PE.FillStopColor =Color.Transparent;
myLegend.Border.CornerRadius = 10;
myLegend.Border.Thickness = 1;
this.ultraChart1.CompositeChart.Legends.Add(myLegend);
Please take a look at the attached sample with compiste scatterChart and composite legend and let me know if you have any questions.
Regards