Here is my resulting chart:
http://s15.postimage.org/7y165x8xn/mychart.jpg
The issue that I have is I need the legend to reflect the same color that is in the pie chart, or it will be really hard to know what number goes with each piece of the pie. I also would love to remove Quantity from the list.
here is my C#
string[] ParamArgs = { "IdParam|" + HttpContext.Current.Session["Id"], "INParam|" + HttpContext.Current.Session["Current"] };
ColorPieChart = StoreProcedureDTTable("ColorPieChart_By_Specific", ParamArgs, "ColorPieChart_By_Specific");
ColorPieChart.ChartTitle.TextBlock.Text = "Quantity by Color";
ColorPieChart.Legend.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.TopRight;
ColorPieChart.DataSource = ColorPieChart;
ColorPieChart.PlotArea.XAxis.AxisLabel.Visible = true;
ColorPieChart.PlotArea.YAxis.AxisLabel.Visible = true;
foreach (DataRow dtRow in ColorPieChart.Rows)
{
LabelItem item = new LabelItem();
item.Name = dtRow["Color"].ToString();
item.TextBlock.Text = dtRow["Color"].ToString();
ColorPieChart.Legend.Items.Add(item);
}
ColorPieChart.AutoLayout = true;
ColorPieChart.DataBind();
Here is my aspx:
<telerik:RadChart ID="ColorPieChart" runat="server"
ChartImageFormat="Jpeg" DefaultType="Pie" Height="400px" Skin="WebBlue"
Width="465px" Appearance-LegendDisplayMode="ItemLabels">
<Appearance>
<FillStyle MainColor="249, 250, 251">
</FillStyle>
<Border Color="160, 170, 182" />
</Appearance>
<Legend>
<Appearance Dimensions-Margins="17.6%, 3%, 1px, 1px"
Dimensions-Paddings="2px, 8px, 6px, 3px"
Position-AlignedPosition="BottomRight">
<ItemTextAppearance TextProperties-Color="102, 102, 102">
</ItemTextAppearance>
<ItemMarkerAppearance Figure="Triangle">
</ItemMarkerAppearance>
<FillStyle MainColor="216, 222, 227">
</FillStyle>
<Border Color="160, 170, 182" />
</Appearance>
</Legend>
<PlotArea>
<EmptySeriesMessage Visible="True">
<Appearance Visible="True">
</Appearance>
</EmptySeriesMessage>
<XAxis>
<Appearance Color="160, 160, 160">
<MajorGridLines Color="227, 227, 227" Width="0" />
<TextAppearance TextProperties-Color="140, 140, 140">
</TextAppearance>
</Appearance>
<AxisLabel>
<TextBlock>
<Appearance TextProperties-Color="140, 140, 140">
</Appearance>
</TextBlock>
</AxisLabel>
</XAxis>
<YAxis>
<Appearance Color="160, 160, 160">
<MajorGridLines Color="227, 227, 227" />
<MinorGridLines Color="227, 227, 227" />
</Appearance>
<AxisLabel>
<TextBlock>
<Appearance TextProperties-Color="140, 140, 140">
</Appearance>
</TextBlock>
</AxisLabel>
</YAxis>
<Appearance>
<FillStyle FillType="Solid" MainColor="">
</FillStyle>
</Appearance>
</PlotArea>
<ChartTitle>
<Appearance>
<FillStyle MainColor="">
</FillStyle>
</Appearance>
<TextBlock Text="Chart by Color Quantity">
<Appearance TextProperties-Color="102, 102, 102"
TextProperties-Font="Arial, 14pt">
</Appearance>
</TextBlock>
</ChartTitle>
</telerik:RadChart>
Any help is appreciated!
http://s15.postimage.org/7y165x8xn/mychart.jpg
The issue that I have is I need the legend to reflect the same color that is in the pie chart, or it will be really hard to know what number goes with each piece of the pie. I also would love to remove Quantity from the list.
here is my C#
string[] ParamArgs = { "IdParam|" + HttpContext.Current.Session["Id"], "INParam|" + HttpContext.Current.Session["Current"] };
ColorPieChart = StoreProcedureDTTable("ColorPieChart_By_Specific", ParamArgs, "ColorPieChart_By_Specific");
ColorPieChart.ChartTitle.TextBlock.Text = "Quantity by Color";
ColorPieChart.Legend.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.TopRight;
ColorPieChart.DataSource = ColorPieChart;
ColorPieChart.PlotArea.XAxis.AxisLabel.Visible = true;
ColorPieChart.PlotArea.YAxis.AxisLabel.Visible = true;
foreach (DataRow dtRow in ColorPieChart.Rows)
{
LabelItem item = new LabelItem();
item.Name = dtRow["Color"].ToString();
item.TextBlock.Text = dtRow["Color"].ToString();
ColorPieChart.Legend.Items.Add(item);
}
ColorPieChart.AutoLayout = true;
ColorPieChart.DataBind();
Here is my aspx:
<telerik:RadChart ID="ColorPieChart" runat="server"
ChartImageFormat="Jpeg" DefaultType="Pie" Height="400px" Skin="WebBlue"
Width="465px" Appearance-LegendDisplayMode="ItemLabels">
<Appearance>
<FillStyle MainColor="249, 250, 251">
</FillStyle>
<Border Color="160, 170, 182" />
</Appearance>
<Legend>
<Appearance Dimensions-Margins="17.6%, 3%, 1px, 1px"
Dimensions-Paddings="2px, 8px, 6px, 3px"
Position-AlignedPosition="BottomRight">
<ItemTextAppearance TextProperties-Color="102, 102, 102">
</ItemTextAppearance>
<ItemMarkerAppearance Figure="Triangle">
</ItemMarkerAppearance>
<FillStyle MainColor="216, 222, 227">
</FillStyle>
<Border Color="160, 170, 182" />
</Appearance>
</Legend>
<PlotArea>
<EmptySeriesMessage Visible="True">
<Appearance Visible="True">
</Appearance>
</EmptySeriesMessage>
<XAxis>
<Appearance Color="160, 160, 160">
<MajorGridLines Color="227, 227, 227" Width="0" />
<TextAppearance TextProperties-Color="140, 140, 140">
</TextAppearance>
</Appearance>
<AxisLabel>
<TextBlock>
<Appearance TextProperties-Color="140, 140, 140">
</Appearance>
</TextBlock>
</AxisLabel>
</XAxis>
<YAxis>
<Appearance Color="160, 160, 160">
<MajorGridLines Color="227, 227, 227" />
<MinorGridLines Color="227, 227, 227" />
</Appearance>
<AxisLabel>
<TextBlock>
<Appearance TextProperties-Color="140, 140, 140">
</Appearance>
</TextBlock>
</AxisLabel>
</YAxis>
<Appearance>
<FillStyle FillType="Solid" MainColor="">
</FillStyle>
</Appearance>
</PlotArea>
<ChartTitle>
<Appearance>
<FillStyle MainColor="">
</FillStyle>
</Appearance>
<TextBlock Text="Chart by Color Quantity">
<Appearance TextProperties-Color="102, 102, 102"
TextProperties-Font="Arial, 14pt">
</Appearance>
</TextBlock>
</ChartTitle>
</telerik:RadChart>
Any help is appreciated!