Windows Phone 7.1 Chart questions

2 posts, 0 answers
  1. Test123
    Test123 avatar
    1 posts
    Member since:
    Feb 2012

    Posted 02 Mar 2012 Link to this post

    Hi,
    I am a experimenting your tool with windows phone 7.1.
    Sorry about too many questions below,

    (a) I would like to know how can i remove gaps between bars,
    I am trying to display each day of month and the amount for the day; hence the space between bars is a lost asset for me. please help.
    (b) How can I show the axis labels on top of the chart instead of bottom?
         I plan to use only portrait layout.
    (c) Can I disable labels altogether and just use trackball (I haven't experimented with it yet) to show labels (for both x and y axis) or details?

    Code is similar to your documentation:

                <chart:RadCartesianChart x:Name="chart">
                    <chart:RadCartesianChart.HorizontalAxis>
                        <chart:DateTimeCategoricalAxis LabelFitMode="MultiLine"
                                                       LabelFormat="dd"
                                       DateTimeComponent="Day"/>
                    </chart:RadCartesianChart.HorizontalAxis>
                    <chart:RadCartesianChart.VerticalAxis>
                        <chart:LinearAxis/>
                    </chart:RadCartesianChart.VerticalAxis>
                    <chart:RadCartesianChart.Series>
                        <chart:BarSeries/>
                        <chart:BarSeries/>
                    </chart:RadCartesianChart.Series>
                </chart:RadCartesianChart>

                DateTime lastDate = DateTime.Now;
                int monthnum = DateTime.Now.Month;
                double lastVal = 20;
                List<ChartDataObject> dataSouce = new List<ChartDataObject>();
                for (int i = 0; lastDate.Month == monthnum;  ++i)
                {
                    ChartDataObject obj = new ChartDataObject
                    {
                        Date =lastDate.Day,
                        Value = lastVal++
                    };
                    dataSouce.Add(obj);
                    lastDate = lastDate.AddDays(1);
                }
                BarSeries series = (BarSeries)this.chart.Series[0];
                series.CategoryBinding = new PropertyNameDataPointBinding()
                {
                    PropertyName =
                        "Date"
                };
                series.ValueBinding = new PropertyNameDataPointBinding()
                {
                    PropertyName =
                        "Value"
                };
                series.ItemsSource = dataSouce;
                series.CombineMode.Equals("Stack");
    /*            lastDate = DateTime.Now;
                lastVal = 40; 
                List<ChartDataObject> dataSouce2 = new List<ChartDataObject>();
                for (int i = 0; lastDate.Month == monthnum; ++i)
                {
                    ChartDataObject obj = new ChartDataObject
                    {
                        Date = lastDate.Day,
                        Value = lastVal++
                    };
                    dataSouce2.Add(obj);
                    lastDate = lastDate.AddDays(1);
                }
    */
    /*            BarSeries series2 = (BarSeries)this.chart.Series[1];
                series2.CategoryBinding = new PropertyNameDataPointBinding()
                {
                    PropertyName =
                        "Date"
                };
                series2.ValueBinding = new PropertyNameDataPointBinding()
                {
                    PropertyName =
                        "Value"
                };
                series2.ItemsSource = dataSouce2;
                series2.CombineMode.Equals("Stack");
     */


  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 06 Mar 2012 Link to this post

    Hi,

    Thanks for the questions.
    The feature from (a) can be enabled via the GapLength property of the categorical axis. For example:

    <telerikChart:CategoricalAxis GapLength="0"/>

    (b) is not currently supported but we will consider implementing it in a future release.

    You can hide the labels by setting a template that does not display anything. For example:
    <telerikChart:LinearAxis>
        <telerikChart:LinearAxis.LabelTemplate>
            <DataTemplate>
                <TextBlock/>
            </DataTemplate>
        </telerikChart:LinearAxis.LabelTemplate>
    </telerikChart:LinearAxis>

    Finally, yes, you can use the trackball to display any information about a data point. You can find information
    on how to use the trackball here.

    Please write again if you have other questions.
    All the best,
    Victor
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
Back to Top