Page 1 of 1

Disappearing title text on chart with polar series

Posted: Thu May 07, 2009 2:07 pm
by 13050248
I've got two charts in a list view. If I select the second chart and select the first one again, the title of the second chart vanishes and doesn't come back again.

I'm using the latest maintenance release: 3.5.3371.26406

Code: Select all

<Window x:Class="WPFDemo.Window7"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:WPF="clr-namespace:Steema.TeeChart.WPF;assembly=TeeChart.WPF"
    Title="Window7" Width="800" Height="600">
    <ScrollViewer>
        <ListView
            SelectedIndex="0"
            ScrollViewer.CanContentScroll="False"
            ScrollViewer.HorizontalScrollBarVisibility="Disabled">
            <ListView.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel Orientation="Horizontal"/>
                </ItemsPanelTemplate>
            </ListView.ItemsPanel>
            <WPF:TChart x:Name="Chart1" Margin="10" Width="300" Height="300"/>
            <WPF:TChart x:Name="Chart2" Margin="10" Width="300" Height="300"/>
        </ListView>
    </ScrollViewer>
</Window>

Code: Select all

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Steema.TeeChart.WPF;
using Steema.TeeChart.WPF.Styles;

namespace WPFDemo
{
    /// <summary>
    /// Interaction logic for Window7.xaml
    /// </summary>
    public partial class Window7 : Window
    {
        public Window7()
        {
            InitializeComponent();

            Chart1.Header.Text = "My Title 1";

            Chart2.Header.Text = "My Title 2";
            var series = createPolarSeries();
            series.ShowInLegend = false;
            var random = new Random(10);
            for (int i = 0; i < 36; i++)
            {
                series.Add(i*10, random.NextDouble());
            }
            addSeries(Chart2, series);
        }

        private Polar createPolarSeries()
        {
            Polar polar = new Polar();
            polar.Brush.Visible = false;
            polar.CircleLabels = true;
            polar.Circled = true;
            polar.RotationAngle = 90; // zero degrees is at top
            polar.RadiusIncrement = 2; // 2 dB increments               
            return polar;
        }

        private void addSeries(TChart chart, Series plot)
        {
            if (plot is Polar)
            {
                Polar polar = (Polar)plot;
                polar.ClockWiseLabels = true; // angles increment clockwise
            }
            chart.Series.Add(plot);
            if (plot is Polar)
            {
                Polar polar = (Polar)plot;
                polar.AngleIncrement = 30; // 30 degrees increments
            }
        }
    }
}

Posted: Fri May 08, 2009 10:07 am
by 10050769
Hello Christo Zietsman,

I could reproduce your issue here, and I have added to the list of Bug Report with number [TW16014139] we will try to fix it for next versions of TeeChart .NET WPF.

Also, I think that bug occurs when use next code:

Code: Select all

<ScrollViewer>
        <ListView
            SelectedIndex="0"
            ScrollViewer.CanContentScroll="False"
            ScrollViewer.HorizontalScrollBarVisibility="Disabled">
            <ListView.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel Orientation="Horizontal"/>
                </ItemsPanelTemplate>
            </ListView.ItemsPanel>
            <WPF:TChart x:Name="Chart1" Margin="10" Width="300" Height="300"/>
            <WPF:TChart x:Name="Chart2" Margin="10" Width="300" Height="300"/>
        </ListView>
    </ScrollViewer> 
Please, you could check that remove this code not ocurrs the issue when you select with click the charts.


Thanks,

Posted: Fri May 08, 2009 12:20 pm
by 13050248
Hi Sandra

I'm not exactly sure what you mean, but it doesn't matter.

If I uncomment the line

Code: Select all

polar.CircleLabels = true;
then the title does not disappear. We want the labels though.

Posted: Fri May 08, 2009 1:24 pm
by narcis
Hi Christo,

Thanks for your feedback. I could reproduce this and updated issue's log. I think Sandra wanted to say that using the charts outside ListView works fine too.