Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8677941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:35:29+00:00 2026-06-12T20:35:29+00:00

I have a chart that is pulling data constantly, and the refresh rate is

  • 0

I have a chart that is pulling data constantly, and the refresh rate is set to 2 minutes at the moment. The problem is that each time the chart updates, the colors change to be whatever is next in the cycle. I thought that perhaps I could have the chart completely reset on refresh, to always start the palette colors at 0 or 1 each time, but so far no luck. Any ideas?

UPDATE

Some XAML/code for a better idea.

XAML for DynamicSeriesChart head

    <ana:DynamicSeriesChart SeriesSource="{Binding ChartSeries}" Title="{Binding ChartTitle}" Palette="{StaticResource ChartPalette}" Grid.Row="1" LegendTitle="Legend" Margin="0,25,0,0" Visibility="{Binding ShowGraph, Converter={StaticResource BoolToVisConv}}">

XAML for Chart Template

        <ana:DynamicSeriesChart.Template>
            <ControlTemplate TargetType="charting:Chart">
                <Border Background="{DynamicResource ContainerElementContentPanelBgBrush}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <datavis:Title Content="{TemplateBinding Title}" Style="{TemplateBinding TitleStyle}" />

                        <chartingprimitives:EdgePanel x:Name="ChartArea" Grid.Row="1" Margin="0,15,0,15" Style="{TemplateBinding ChartAreaStyle}">
                            <Grid Canvas.ZIndex="-1" Style="{TemplateBinding PlotAreaStyle}" />
                            <Border Canvas.ZIndex="10" BorderBrush="#FF919191" BorderThickness="1" />
                        </chartingprimitives:EdgePanel>

                        <datavis:Legend x:Name="Legend" Style="{TemplateBinding LegendStyle}" Grid.Row="2" HorizontalAlignment="Left">
                            <datavis:Legend.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <WrapPanel Orientation="Horizontal"/>
                                </ItemsPanelTemplate>
                            </datavis:Legend.ItemsPanel>
                        </datavis:Legend>
                    </Grid>
                </Border>
            </ControlTemplate>
        </ana:DynamicSeriesChart.Template>

Sample from Palette

<Style x:Key="ColumnSeries1Style" TargetType="Control">
    <Setter Property="Background" Value="#FFFFA500" />
</Style>
<Style x:Key="ColumnSeries1Style2" TargetType="Shape">
    <Setter Property="Fill" Value="#FFFFA500" />
    <Setter Property="Stroke" Value="#FFFFA500" />
</Style>
...

…

<datavis:ResourceDictionaryCollection x:Key="ChartPalette">
    <ResourceDictionary>
        <Style x:Key="DataPointStyle" BasedOn="{StaticResource ColumnSeries1Style}" TargetType="Control" />
        <Style x:Key="DataShapeStyle" BasedOn="{StaticResource ColumnSeries1Style2}" TargetType="Shape" />
    </ResourceDictionary>
...

The reload calls Refresh(), which is a long query that sets new Params. That goes to LoadData(), which goes to ApplyResults(), which clears the ChartSeries and then applies the new values.

(I’m hesitant to put up code-behind or cs as none of it is mine (and still somewhat confusing to me, references and references everywhere). I’m still relatively new at being involved with it in this project, and still discovering new parts as I try to solve this. If specifics or operation flow is needed I’ll do my best to hunt down those parts.)

And upon refreshing, the chart (which can be either Area, Bar, Column, or Line) will cycle through the palette colors. For example, lets say 3 bars, currently red/blue/orange. Upon the refresh to update the chart with new data, the colors will change and cycle to whatever is next in the palette – lets say purple/yellow/green. And it will continue cycling throughout the palette (and therefor changing the chart and its legend) for each refresh of data. This happens even without the custom palette.

UPDATE

Looking closer at the issues, the “Line” graph does not have the same behavior as the others. So it is only Column/Bar/Area charts that have this problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T20:35:30+00:00Added an answer on June 12, 2026 at 8:35 pm

    If your line graph is working, but the other ones have cycling colors, you could style the Palette property to check what type of graph is being used. Then you could apply the whole color palette to the line graph, but have the others convert an index (that you would add to wherever your data is coming from) to a color. For details on the conversion process, see this question.

                <Style TargetType="ana:DynamicSeriesChart">
                <Setter Property="Palette" Value="{StaticResource ChartPalette}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsLineGraph}" Value="False">
                        <Setter Property="Palette">
                            <Setter.Value>
                                <datavis:ResourceDictionaryCollection>
                                    <ResourceDictionary>
                                        <Style x:Key="DataPointStyle" TargetType="Control">
                                            <Setter Property="Background" Value="{Binding Path=PointColorIndex, 
                                Converter={StaticResource IndexColorConverter}, 
                                ConverterParameter={StaticResource ChartPalette}}"/>
                                        </Style>
                                        <Style x:Key="DataShapeStyle" TargetType="Shape">
                                            <Setter Property="Fill" Value="{Binding Path=FillColorIndex, 
                                Converter={StaticResource IndexColorConverter}, 
                                ConverterParameter={StaticResource ChartPalette}}"/>
                                            <Setter Property="Stroke" Value="{Binding Path=StrokeColorIndex, 
                                Converter={StaticResource IndexColorConverter}, 
                                ConverterParameter={StaticResource ChartPalette}}"/>
                                        </Style>
                                    </ResourceDictionary>
                                </datavis:ResourceDictionaryCollection>
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have chart.png with data in it that I would like to put a
I have a simple chart (albeit with a lot of data) that renders fine
I have a line chart that is updated every so and so seconds, similar
I have a WPF Chart that I am dynamically binding a BarSeries to. I
I have a jqPlot pie chart that I am loading by reading an XML
I have a simple JSF line chart that uses PrimeFaces (via jqPlot) library: <p:lineChart
I have a chart generated from Google Charts that can be found here: Chart
I have a chart (code to replicate will be below) that has two lines
I have created a line chart using Reporting Services that charts the number of
I have a matplotlib code that generates a simple 2D chart. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.