Jump to content
Software FX Community

bskidan

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by bskidan

  1. Thank you, Juan. This works great - exactly what I was looking for.
  2. I'm trying to format series ToolTip using my own DataTemplate. The tooltip is formated correctly, but it is displayed within another element (ToolTip I guess) that I can't find a way to get rid of. The element is formatted based on the style that the chart uses (Basic in my case - light yellow rectangle). All I need is a rounded rectangle using my application colors. Xaml below:<cfx:Chart Name="_dataChart" Style="{x:Static cfxmotifs:Basic.Style}" DataBound="_dataChart_DataBound"> <cfx:Chart.Series> <cfx:SeriesAttributes BindingPath="SeriesA" Content="Series A" Gallery="Area"> <cfx:SeriesAttributes.ToolTips> <cfx:ToolTipAttributes ConnectedStyle="Closest"> <cfx:ToolTipAttributes.Template> <DataTemplate> <Grid DataContext="{Binding Path=DataItem}"> <Border Background="Black" BorderThickness="1" CornerRadius="5" Padding="5"> <StackPanel> <TextBlock Text="{Binding Timestamp, StringFormat=d}" Foreground="LimeGreen"/> <TextBlock Text="{Binding SeriesA, StringFormat=#}" Foreground="Red"/> </StackPanel> </Border> </Grid> </DataTemplate> </cfx:ToolTipAttributes.Template> </cfx:ToolTipAttributes> </cfx:SeriesAttributes.ToolTips> </cfx:SeriesAttributes> </cfx:Chart.Series> <cfx:Chart.AxisX> <cfx:Axis> <cfx:Axis.Labels> <cfx:AxisLabelAttributes BindingPath="Timestamp" CustomFormat="MM-dd-yy"/> </cfx:Axis.Labels> </cfx:Axis> </cfx:Chart.AxisX></cfx:Chart> Thank you.
  3. Ok, found this one myself. Instead of specifying Axis inside SeriesAttributes element I've created an aixis on the chart level and only referenced the existing axis from my series: <cfx:Chart Name="_dataChart" Style="{x:Static cfxmotifs:Basic.Style}"> <cfx:Chart.AxesY> <cfx:Axis Position="Near"> <cfx:Axis.Labels> <cfx:AxisLabelAttributes BindingPath="SeriesA" /> </cfx:Axis.Labels> </cfx:Axis> </cfx:Chart.AxesY> <cfx:Chart.Series> <cfx:SeriesAttributes BindingPath="SeriesA" Content="Series A" Gallery="Area" cfx:Axis.Index="0"/> </cfx:Chart.Series> </cfx:Chart>
  4. JuanC, Thank you very much. This is exactly what I was looking for.
  5. Thanks for your prompt reply. The reason I wanted templates is to attach converter to format labels the way I would like them to look. I work with financial data and my values range varies from one set of data to another and can be in tens or hundreds of thousands, or millions, or tens of millions. A simple currency format displays something like $10,000,000, which is too long. I tried to play around with ScaleUnit and CustomFormat and came up with something like this: <cfx:AxisLabelAttributes ScaleUnit="1000000" CustomFormat="$#,0.##M;($#,0.##M)"/> This displays labels like $5M and ($2M), but steps them in 1M increments. So now I have to set Axis.Step, which I have to calculate, thus duplicating logic already implemented in your control. Also 'M' is not always appropriate and sometimes should be set to 'K'. What I really need is to apply dynamic format that depends on the value only for those labels that the control decides to display in a default scenario. Ideally the resulting labels will read $0, $200K, ..., $1M, $1.2M. Any ideas? Thanks.
  6. I'm trying to provide my own DataTemplate for AxisY labels. This works for AxisX but not for AxisY. Does this even suppose to work? <cfx:Chart Name="_dataChart"> <cfx:Chart.Series> <cfx:SeriesAttributes BindingPath="SeriesA" Content="Series A" Gallery="Area"> <cfx:SeriesAttributes.AxisY> <cfx:Axis> <cfx:Axis.Template> <DataTemplate> <TextBlock Text="{Binding DataItem.SeriesA, StringFormat='#,0.##'}" /> </DataTemplate> </cfx:Axis.Template> </cfx:Axis> </cfx:SeriesAttributes.AxisY> </cfx:SeriesAttributes> </cfx:Chart.Series> <cfx:Chart.AxisX> <cfx:Axis> <cfx:Axis.Template> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="On " /> <TextBlock Text="{Binding DataItem.Timestamp, StringFormat=d}" /> </StackPanel> </DataTemplate> </cfx:Axis.Template> </cfx:Axis> </cfx:Chart.AxisX></cfx:Chart>Thanks.
  7. I'm populating chart with some data based on user selection. Data values ranges are different for each user selection. When simple chart is configured without explicit AxisY it works fine, changing scale up or down to fit the actual values: <cfx:Chart Name="_dataChart"> <cfx:Chart.Series> <cfx:SeriesAttributes BindingPath="SeriesA" Content="Series A" Gallery="Area"/> </cfx:Chart.Series> </cfx:Chart> But if I specify AxisY to format labels the the scale grows to accommodate larger values but never shrinks: <cfx:Chart Name="_dataChart"> <cfx:Chart.Series> <cfx:SeriesAttributes BindingPath="SeriesA" Content="Series A" Gallery="Area"> <cfx:SeriesAttributes.AxisY> <cfx:Axis> <cfx:Axis.Labels> <cfx:AxisLabelAttributes Format="Currency"/> </cfx:Axis.Labels> </cfx:Axis> </cfx:SeriesAttributes.AxisY> </cfx:SeriesAttributes> </cfx:Chart.Series> </cfx:Chart> I'm attaching fully working solution to demonstrate the problem. Thanks.
  8. Thanks. How can I get the latest hot fix? I'm using eval version and the only build I can download from your web site is 3422.
  9. Any updates on this one? Or an ETA when it may become available? Thanks.
  10. Hi. I was trying to use your example, but it doesn't compile: 'ItemAttributes' property is read-only and cannot be set from markup. Any suggestions how to fix it? I need a very simple scenario where I hide one specific item from the legend. I'm evaluating version 8.0.3422. Thanks, Boris.
×
×
  • Create New...