Jump to content
Software FX Community

How can i display dataview with pie chart


hee

Recommended Posts

Currently we switch the dataview display depending on the location. If it is docked to the left or right, each dataview row will correspond to an item in your data. If it is docked to the top or bottom, we display each item on a different column.

This is done primarily to try to take advantage of the available space assuming a typical chart has more items than series. We will consider adding a property to control this in future builds.

About displaying percentages, we do not have a specific feature that will help you accomplish this. We will research if we can support this in future builds as well.

Regards,

JuanC

Link to comment
Share on other sites

Future builds will support the following new properties

DataView.Fields.Orientation: Specifies whether fields should have a vertical, horizontal or Auto orientationSeriesField.Template: Allows to template a SeriesField. You can use this in conjunction with our ToolTipConverter

e.g.

<

cfx:Chart Gallery="Pie" x:Name="chart1" ItemsSource="{Binding Source={StaticResource myXmlData}}">  <cfx:Chart.Series>   <cfx:SeriesAttributes BindingPath="@Sales"/>  </cfx:Chart.Series>  <cfx:Chart.AxisX>   <cfx:Axis>   <cfx:Axis.Labels>   <cfx:AxisLabelAttributes BindingPath="@Name"/>   </cfx:Axis.Labels>   </cfx:Axis>  </cfx:Chart.AxisX>  <cfx:Chart.DataView>   <cfx:DataView Visibility="Visible">   <cfx:DataView.Fields>   <cfx:DataViewFieldAttributes Orientation="Vertical">   <cfx:DataViewFieldAttributes.Items>   <cfx:AxisField ShowMarkers="true"/>   <cfx:SeriesField SeriesIndex="0">   <cfx:SeriesField.Template>   <DataTemplate>   <DataTemplate.Resources>   <cfxConverters:TooltipConverter x:Key="tooltipConverter"/>   </DataTemplate.Resources>   <TextBlock Text="{Binding Path=Self, Converter={StaticResource tooltipConverter}, ConverterParameter=%v (%p%%)}" Margin="{Binding Path=Margin}" Foreground="{Binding Path=Foreground}" FontFamily="{Binding Path=FontFamily}" FontWeight="{Binding Path=FontWeight}" FontSize="{Binding Path=FontSize}" FontStyle="{Binding Path=FontStyle}" HorizontalAlignment="Right" VerticalAlignment="Center"/>   <DataTemplate.Triggers>   <DataTrigger Binding="{Binding Path=Dimmed}">   <DataTrigger.Value>   <sys:Boolean>True</sys:Boolean> </DataTrigger.Value> <Setter Property="Opacity" Value="0.25" />  </DataTrigger>  </DataTemplate.Triggers>  </DataTemplate>  </cfx:SeriesField.Template>  </cfx:SeriesField>  </cfx:DataViewFieldAttributes.Items>  </cfx:DataViewFieldAttributes>  </cfx:DataView.Fields>  </cfx:DataView>  </cfx:Chart.DataView></cfx:Chart>

A little verbose but it will get the job done

Regards,

JuanC

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...