Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
415
XamChart functionality questions
posted

Hi,

I need to make a chart (or figure rather) with some specific requirements- I am wondering if XamChart can handle most of these things.   Here is what I need:

1. One axis only (X) at the top of the chart, with custom ranges (i.e. start at 16,000 end at 16,900 or something).

2. The ability to represent data points with an embedded user control.  Basically, I have a usercontrol that contains a couple textboxes in a grid with data pulled from the viewmodel.  Each one of these viewmodels would have an X value that corresponds to the X axis (this is a calcuated value), and a height and represents one data point.  The list of datapoints/usercontrols come from another viewmodel.  The list itself is an ObservableCollection of viewmodels.

3. If datapoint/usercontrol elements overlap on the x axis they stack, i.e. only one per 'row'.

4. Scaling.  I think I get this for free, but just want to double check that usercontrols are also scaled.

I think I would have no problem with 1 but Im not sure of the others.

I may have to write a custom panel for this, but it seems like xamchart might be able to help.  Can anyone shed some light on whether I can accomplish these things?  If so, examples or links to examples are GREATLY appreciated!

 

Parents
No Data
Reply
  • 28496
    Suggested Answer
    Offline posted

    here's some code to get you started.  it should fulfill all four of those requirements.  you can replace the Ellipse in the DataTemplate with your UserControl. please let me know if you have any questions.

    <igChart:XamChart>
                <igChart:XamChart.Resources>
                    <DataTemplate DataType="{x:Type igChart:ColumnChartTemplate}">
                        <Ellipse Stretch="Fill" Fill="Red" />
                    </DataTemplate>
                </igChart:XamChart.Resources>
                <igChart:XamChart.Series>
                    <igChart:Series UseDataTemplate="True">
                        <igChart:Series.DataPoints>
                            <igChart:DataPoint Value="1" />
                            <igChart:DataPoint Value="2" />
                            <igChart:DataPoint Value="3" />
                        </igChart:Series.DataPoints>
                    </igChart:Series>
                </igChart:XamChart.Series>
                <igChart:XamChart.Axes>
                    <igChart:Axis AxisType="PrimaryX" Visible="False" />
                    <igChart:Axis AxisType="SecondaryX" Visible="True" />
                    <igChart:Axis AxisType="PrimaryY" Visible="False" />
                </igChart:XamChart.Axes>
            </igChart:XamChart>

Children
No Data