We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

The metric of chart doesn't display

Hi All,

After I set the theme of page to dark, the chart works fine but the metric doesn't play, please view the pic.

untitled

And here are the codes:


<Page
    x:Class="App1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App1"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Charts="using:Syncfusion.UI.Xaml.Charts"
    RequestedTheme="Dark"
    mc:Ignorable="d" xmlns:syncfusion="using:Syncfusion.UI.Xaml.Controls">
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Charts:SfChart x:Name="cMainIO" Grid.Row="2">
            <Charts:SfChart.Behaviors>
                <Charts:ChartZoomPanBehavior/>
            </Charts:SfChart.Behaviors>
            <Charts:SfChart.PrimaryAxis>
                <Charts:CategoryAxis x:Name="Primaryx" LabelFormat="MM/dd" />
            </Charts:SfChart.PrimaryAxis>
            <!--SecondaryAxis with range customization-->
            <Charts:SfChart.SecondaryAxis>
                <Charts:NumericalAxis RangePadding="Round" StartRangeFromZero="False" />
            </Charts:SfChart.SecondaryAxis>
            <Charts:ColumnSeries ItemsSource="{Binding}" XBindingPath="DataDate" YBindingPath="Value" Foreground='White' >
                <Charts:ColumnSeries.CustomTemplate>
                    <DataTemplate>
                        <Canvas>
                            <Rectangle Fill="Red" Height="{Binding Height}" Width="{Binding Width}" Canvas.Left="{Binding RectX}" Canvas.Top="{Binding RectY}"></Rectangle>
                        </Canvas>
                    </DataTemplate>
                </Charts:ColumnSeries.CustomTemplate>
            </Charts:ColumnSeries>
        </Charts:SfChart>
    </Grid>
</Page>


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
namespace App1
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
            List<Modelx> ms = new List<Modelx>();
            ms.Add(new Modelx() { DataDate = DateTime.Now.AddDays(-1), Value = 10 });
            ms.Add(new Modelx() { DataDate = DateTime.Now, Value = 13 });
            ms.Add(new Modelx() { DataDate = DateTime.Now.AddDays(1), Value = 7 });
            cMainIO.DataContext = ms;
        }
    }

    class Modelx
    {
        public DateTime DataDate { get; set; }
        public int Value { get; set; }
    }
}

Thanks.

1 Reply

RA Rachel A Syncfusion Team September 7, 2015 11:01 AM UTC

Hi William,
 
Thanks for contacting Syncfusion support.
 
We are able to reproduce the issue. Meanwhile you can change the RequestedTheme to Dark in App.Xaml instead of MainPage.Xaml .The fix for this issue will be available in our upcoming main release Vol 3 which is scheduled to be rolled out by the end of September 2015 tentatively.

Regards,
Rachel. A

Loader.
Live Chat Icon For mobile
Up arrow icon