[CLOSED] Legend color problem on pi3D chart with custom color

  1. #1

    [CLOSED] Legend color problem on pi3D chart with custom color

    Hello

    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.
  2. #2
    Hello @feanor91!

    I'm afraid that's an old issue... Well, old issues tend to become features, right?

    Anyway, I am confident the discussion in this thread are the best way to go with it, and how we do in the examples: Chosing the color of the stacked bar chart based.

    You may try defining your own chart-theme too. It would be nice to get some feedback on this comment from Daniil: ext:ChartTheme option.

    I hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello @feanor91!

    It's been a while since we replied your inquiry here and you left us no feedback so far. Do you still need help with this? Did the threads above help you address your issue with the legend colors in pie3d charts at all?

    If you don't reply in 7+ days from now we will be marking this thread as closed. But that is not going to prevent you from posting a follow-up here even after that happens.
    Fabrício Murta
    Developer & Support Expert
  4. #4
    Hi

    Yes, I solved it, I left Pie3D and use Pie2D.
  5. #5
    Hello @feanor91!

    Sorry to hear that, but glad you could make your desired behavior work with the 2D Pie chart component. Thank you very much for your feedback!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] Increase the height of legend, Change line color of chart
    By praveencat123 in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 26, 2015, 2:26 PM
  2. Replies: 2
    Last Post: Jul 23, 2014, 1:02 PM
  3. [CLOSED] problem line color into the chart for different browser
    By tactime10 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 19, 2013, 6:50 PM
  4. [CLOSED] Chart.Legend background color ?
    By Zenalyse in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 19, 2013, 1:57 PM
  5. [CLOSED] Is there any way we can give custom legend label in chart
    By advBackOffice in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 05, 2012, 4:15 PM

Posting Permissions