Hi,
I need to create a thermometer chart. By default I am getting 3 Series and 4 categories but i need only 1 Series and 1 Catgeories. I am unable to create the chart. I am trying to achieve this using a column clustered chart. Thanks.
Here's my code:
RectangleF rect3 = new RectangleF(1095, 105, 146, 437);
IChart clusteredChart = presentation.Slides[1].Shapes.AppendChart(Spire.Presentation.Charts.ChartType.ColumnClustered, rect3);
clusteredChart.ChartTitle.TextProperties.Text = " ";
clusteredChart.ChartTitle.TextProperties.IsCentered = true;
clusteredChart.ChartTitle.Height = 1;
clusteredChart.HasTitle = true;
clusteredChart.HasLegend = false;
clusteredChart.PlotArea.Height = 350;
//remove grid lines
clusteredChart.PrimaryValueAxis.MajorGridTextLines.FillType = FillFormatType.Solid;
clusteredChart.PrimaryValueAxis.MajorGridTextLines.FillFormat.SolidFillColor.Color = Color.White;
clusteredChart.PrimaryCategoryAxis.MajorGridTextLines.FillType = FillFormatType.None;
clusteredChart.PrimaryValueAxis.IsAutoMax = false;
clusteredChart.PrimaryValueAxis.IsAutoMin = false;
clusteredChart.PrimaryValueAxis.MinValue = 0;
clusteredChart.PrimaryValueAxis.MaxValue = 10;
//remove horinzotal and vertical axis.
clusteredChart.PrimaryCategoryAxis.IsVisible = false;
clusteredChart.PrimaryValueAxis.IsVisible = false;
// remove series
clusteredChart.Series.RemoveAt(2);
clusteredChart.Series.RemoveAt(1);
clusteredChart.Series.Capacity = 1;
clusteredChart.Categories.Capacity = 1;
clusteredChart.Categories.RemoveAt(2);
clusteredChart.Categories.RemoveAt(1);
clusteredChart.Categories.RemoveAt(0);
for (int j = 0; j < 4; j++)
{
clusteredChart.ChartData[j + 1, 1].Value = 8.1;
clusteredChart.Series[0].Values[j].Value = 8.1;
}
//set border
clusteredChart.Series[0].Line.FillType = FillFormatType.Solid;
clusteredChart.Series[0].Line.SolidFillColor.Color = Color.White;
clusteredChart.Series[0].Fill.SolidColor.KnownColor = KnownColors.Gray;
clusteredChart.GapWidth = 25;
clusteredChart.OverLap = 100;
RectangleF rectEllipse = new RectangleF(1102, 461, 127, 127);
IAutoShape ellipse = presentation.Slides[1].Shapes.AppendShape(ShapeType.Ellipse, rectEllipse);
ellipse.Fill.FillType = FillFormatType.Solid;
ellipse.Fill.SolidColor.Color = Color.FromArgb(216, 59, 1);
ellipse.Line.FillType = FillFormatType.None;