Jump to content
Software FX Community

rudi

Members
  • Posts

    16
  • Joined

  • Last visited

Everything posted by rudi

  1. Thanks for the detailed feedback.
  2. Hi JuanC, The reason I'm using the conditional attributes is that the color depends on the value. I want 1 always to be green, 3 always to be red, etc. I don't know however if all values are always there. There might be only 3, which should turn the whole pie chart red, and not green because that's the first Pointattribute in the list. Can I use pointvalues to ensure the mapping between color and Value?
  3. Hi, I'm having a disconnect between the color of my legend items and the colors in the chart when using conditional attributes. Is there something I need to do in additiona to have the legend follow the chart colors? The code I have for my chart is: <ContentControl x:Key="ContentControlChartWorkflowRunStatus"> <ChartFX:Chart Name="chartWorkflowRunStatus" Gallery="Pie"> <ChartFX:Chart.ItemsSource> <Binding Source="{StaticResource TheViewSource}"/> </ChartFX:Chart.ItemsSource> <ChartFX:Chart.DataTransforms> <ChartFXData:CrosstabTransform RowPath="RunStatusCode"/> </ChartFX:Chart.DataTransforms> <ChartFX:Chart.Titles> <ChartFX:Title>Run Status</ChartFX:Title> </ChartFX:Chart.Titles> <ChartFX:Chart.ConditionalAttributes> <ChartFX:ConditionalAttributes Fill="Green"> <ChartFX:ConditionalAttributes.Condition> <ChartFX:RangeCondition From="1" To="1" BindingPath="RunStatusCode"/> </ChartFX:ConditionalAttributes.Condition> </ChartFX:ConditionalAttributes> <ChartFX:ConditionalAttributes Fill="WhiteSmoke"> <ChartFX:ConditionalAttributes.Condition> <ChartFX:RangeCondition From="2" To="2" BindingPath="RunStatusCode"/> </ChartFX:ConditionalAttributes.Condition> </ChartFX:ConditionalAttributes> <ChartFX:ConditionalAttributes Fill="Red"> <ChartFX:ConditionalAttributes.Condition> <ChartFX:RangeCondition From="3" To="3" BindingPath="RunStatusCode"/> </ChartFX:ConditionalAttributes.Condition> </ChartFX:ConditionalAttributes> <ChartFX:ConditionalAttributes Fill="OrangeRed"> <ChartFX:ConditionalAttributes.Condition> <ChartFX:RangeCondition From="4" To="4" BindingPath="RunStatusCode"/> </ChartFX:ConditionalAttributes.Condition> </ChartFX:ConditionalAttributes> <ChartFX:ConditionalAttributes Fill="BurlyWood"> <ChartFX:ConditionalAttributes.Condition> <ChartFX:RangeCondition From="5" To="5" BindingPath="RunStatusCode"/> </ChartFX:ConditionalAttributes.Condition> </ChartFX:ConditionalAttributes> <ChartFX:ConditionalAttributes Fill="BlueViolet"> <ChartFX:ConditionalAttributes.Condition> <ChartFX:RangeCondition From="6" To="6" BindingPath="RunStatusCode"/> </ChartFX:ConditionalAttributes.Condition> </ChartFX:ConditionalAttributes> <ChartFX:ConditionalAttributes Fill="Black"> <ChartFX:ConditionalAttributes.Condition> <ChartFX:RangeCondition From="15" To="15" BindingPath="RunStatusCode"/> </ChartFX:ConditionalAttributes.Condition> </ChartFX:ConditionalAttributes> </ChartFX:Chart.ConditionalAttributes> </ChartFX:Chart> </ContentControl>
  4. rudi

    Timespan axis format

    The solutions works great, thanks. PieChartTabIssue.zip
  5. HI, I'm looking for some guidance as to how to format the Y axis nicely when it shows a timespan. I'm adding 5 points is a test, varying from 1 second to 3 seconds. On my Y-axis I see the value of 00:00:01 9 times and 00:00:02 10 times, while I would like to see it just once, as I would with standard numbers. Any thoughts? < Window x:Class="WpfApplicationTestGraph.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="600" Width="800" xmlns:my="clr-namespace:ChartFX.WPF;assembly=ChartFX.WPF" xmlns:my1="clr-namespace:ChartFX.WPF.Motifs;assembly=ChartFX.WPF" xmlns:cfxData="clr-namespace:ChartFX.WPF.Data;assembly=ChartFX.WPF.Data"> <Grid> <my:Chart Name="chart1" Gallery="Line" Style="{x:Static my1:Basic.Style}"> <my:SeriesAttributes ItemsSource="{Binding Path=TheData}" BindingPath="RunDuration" Content="RunDuration"/> <my:Chart.Titles> <my:Title>Workflow Run Time</my:Title> </my:Chart.Titles> <my:Chart.AxesY> <my:Axis> <my:Axis.Labels> <my:AxisLabelAttributes Format="TimeSpan" CustomFormat="hh:mm:ss"/> </my:Axis.Labels> </my:Axis> </my:Chart.AxesY> </my:Chart></Grid> </ Window>
  6. Works great. Thanks! As a reference to others: <ChartFX:Chart Gallery="Pie" ItemsSource="{Binding Source={StaticResource TaskViewSource}, Path=CurrentItem.RunStatistics}"> <ChartFX:Chart.DataTransforms> <ChartFXData:CrosstabTransform RowPath="RunStatusCode" Sorted="False"/> </ChartFX:Chart.DataTransforms> <ChartFX:Chart.Titles> <ChartFX:Title>Run Status</ChartFX:Title> </ChartFX:Chart.Titles> <ChartFX:Chart.ConditionalAttributes> <ChartFX:ConditionalAttributes Fill="Green"> <ChartFX:ConditionalAttributes.Condition> <ChartFX:RangeCondition From="1" To="1" BindingPath="RunStatusCode"/> </ChartFX:ConditionalAttributes.Condition> </ChartFX:ConditionalAttributes> <ChartFX:ConditionalAttributes Fill="WhiteSmoke"> <ChartFX:ConditionalAttributes.Condition> <ChartFX:RangeCondition From="2" To="2" BindingPath="RunStatusCode"/> </ChartFX:ConditionalAttributes.Condition> </ChartFX:ConditionalAttributes> </ChartFX:Chart.ConditionalAttributes> </ChartFX:Chart>
  7. Hi, I'm afraid I'll need some more help with this. The value of 1 should be green and 3 red. When I use only 1 condition that has From value of 1 and BindingPath set to Y the pies are always green, which seems to make sense. If I however add the second condition everythings gets the first color of the pallet (blue in my case). Could you help me find out what I do wrong? The code I have is: <ChartFX:Chart.ConditionalAttributes> <ChartFX:ConditionalAttributes Fill="Green"> <ChartFX:ConditionalAttributes.Condition> <ChartFX:RangeCondition From="1" To="1" FromOpen="True" BindingPath="Y"/> </ChartFX:ConditionalAttributes.Condition> </ChartFX:ConditionalAttributes> <ChartFX:ConditionalAttributes Fill="Red"> <ChartFX:ConditionalAttributes.Condition> <ChartFX:RangeCondition From="3" To="3" FromOpen="True" BindingPath="Y"/> </ChartFX:ConditionalAttributes.Condition> </ChartFX:ConditionalAttributes> </ChartFX:Chart.ConditionalAttributes>AnnotationView.txt
  8. I need to fix the colors of a piechart. For example 1 is always green, 2 is always red etc. At the moment the colors of the first slice is always blue, no mather whether its value is 1 or 2. I'm not sure to what would be the best way of achieving this. Do I need to modify the template where I can take the Styling Pie example in your installation as a sample? Is it better to use the Conditional attributes? Is there a third way that would be the best? Could you please let me know what would be the best way of achieving this? Thanks, Rudi.
  9. Hi, I have a timespan attribute on the Y-axis, and I'm formatting it with the xaml code below. The CustomFormat seems ignored tho. Is that only working for DateTime attributes? The times I get on the Y-axis are in the form of "00:00:05.7272727", which is a littlebit too detailed. <ChartFX:Axis.Labels> <ChartFX:AxisLabelAttributes Format="TimeSpan" CustomFormat="h:m:s"/> </ChartFX:Axis.Labels>
  10. Thanks, works well and I would never have figured this out myself.
  11. Hi, I'm using a CrosstabTranformation in order to obtain the results I want in a Pie chart. What's currently being displayed is a numerical value, and I would like to use a converter in order to show the textual description of that value in the Legend. <ChartFX:Chart Grid.Column="2" Grid.RowSpan="3" Gallery="Pie"> <ChartFX:Chart.ItemsSource> <Binding ElementName="DataGridControlTaskDetails" Path="ItemsSource"/> </ChartFX:Chart.ItemsSource> <ChartFX:Chart.DataTransforms> <ChartFXData:CrosstabTransform RowPath="RunStatusCode" Sorted="False"/> </ChartFX:Chart.DataTransforms> </ChartFX:Chart> Thanks, Rudi.
  12. Thanks a lot for you quick support on this!
  13. Hello, I'm binding to a observablecollection containing a field called Result. The content of Result can be Success, Failed or Running. What I would like to show in a Pie chart is the distribution of this field. Let's say I have 4 items in the observablecollection of which 2 are Success, 1 is Failed and 1 is Running. What I would like to see in my chart is one slice of 50% and two of 25%. What I'm getting at the moment is 4 slices. Is it possible to obtain this via the Chart control or do I need to prepare the data before I bind to the SeriesAttributes? Thanks for all help. Rudi.
×
×
  • Create New...