Jun 21, 2017, 2:50 PM
[CLOSED] Legend color problem on pi3D chart with custom color
Hello
Here the test code:
Here the test code:
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.IO" %>
<script runat="server">
protected void DataSet1(object sender, DirectEventArgs e)
{
this.chartTop10Country.GetStore().DataSource = this.DS1;
this.chartTop10Country.GetStore().DataBind();
this.chartTop10Country.Call("refreshLegendStore");
}
protected void DataSet2(object sender, DirectEventArgs e)
{
this.chartTop10Country.GetStore().DataSource = this.DS2;
this.chartTop10Country.GetStore().DataBind();
this.chartTop10Country.Call("refreshLegendStore");
}
private object[] DS1
{
get
{
return new object[]
{
new object[] { "A", 71.72 },
new object[] { "B", 29.01 },
new object[] { "C", 83.81 },
new object[] { "D", 52.55 }
};
}
}
private object[] DS2
{
get
{
return new object[]
{
new object[] { "E", 30 },
new object[] { "F", 45 },
new object[] { "G", 25 },
new object[] { "H", 10 }
};
}
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title></title>
<link href="/resources/css/examples.css" rel="stylesheet" />
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<h1>Refresh legend sample</h1>
<ext:Panel
runat="server"
Title="Area Chart"
Width="800"
Height="600"
Layout="FitLayout">
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:ToolbarFill runat="server" />
<ext:Button
runat="server"
Text="Dataset 1"
Icon="ArrowRefresh"
OnDirectClick="DataSet1" />
<ext:Button
runat="server"
Text="DataSet 2"
Icon="ArrowRefresh"
OnDirectClick="DataSet2" />
</Items>
</ext:Toolbar>
</TopBar>
<Items>
<ext:PolarChart
ID="chartTop10Country"
runat="server"
Shadow="true"
InsetPadding="60"
InnerPadding="20">
<LegendSpriteConfig runat="server" />
<Store>
<ext:Store
runat="server"
AutoDataBind="true">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="Country" />
<ext:ModelField Name="Created" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<Interactions>
<ext:ItemHighlightInteraction />
<ext:RotateInteraction />
</Interactions>
<Series>
<ext:Pie3DSeries
AngleField="Created"
ShowInLegend="true"
Colors="#00FFFF,#2BFFD4,#55FFAA,#80FF7F"
Donut="30">
<Label Field="Country" Display="Rotate" FontSize="18" FontFamily="Arial" />
</ext:Pie3DSeries>
</Series>
</ext:PolarChart>
</Items>
</ext:Panel>
</form>
</body>
</html>
as you can see, colors are not shown in the legend.
Last edited by fabricio.murta; Jul 17, 2017 at 5:29 PM.