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
780
Chart Disappears when inside a XamWebDialogWindow
posted

If I dynamically add a Chart to a DialogWindow and minimize & restore the window, the chart disappears.

Repro Steps:

1) App starts with window in normalized state. 
2) Minimize the window.
3) Maximize the window.  Notice chart is gone, but Legend still exists.
4) Normalize the window.  Notice now the chart is completely gone.

It looks like it only happens when using the separate MinimizedPanel for the window, but I'm not positive.  Any suggestions on workarounds?  Also, can you try against the service release build and see if it happens there too?  I really want to be able to offer the charts in windows for my app.

Thanks,
Keith


Repro XAML:

<UserControl x:Class="WindowingTest.ChartWindowTest"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Height="300" Width="300">
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="50" />
        </Grid.RowDefinitions>   
        <Canvas Grid.Row="0" x:Name="CanvasWindows" />
        <StackPanel Grid.Row="1" x:Name="PanelMinimized" Orientation="Horizontal" />       
    </Grid>
</UserControl>

Code Behind:

void ChartWindowTest_Loaded(object sender, RoutedEventArgs e)
{
    var data = new List<KeyValuePair<string, int>>();
    data.Add(new KeyValuePair<string, int>("Category 1", 50));
    data.Add(new KeyValuePair<string, int>("Category 2", 100));
    data.Add(new KeyValuePair<string, int>("Category 3", 20));
    data.Add(new KeyValuePair<string, int>("Category 4", 80));

    var chart = new XamWebChart();
    var series = new Series()
    {
        ChartType = ChartType.Bar,
        DataMapping = "Value = Value;Label = Key",
        DataSource = data
    };
    chart.Series.Add(series);

    var window = new XamWebDialogWindow()
    {
        Content = chart,
        MinimizedPanel = this.PanelMinimized,
        Header = "Chart",
        Width = 200,
        Height = 200,
    };

    this.CanvasWindows.Children.Add(window);
}

 

Parents
  • 780
    posted

    I've narrowed down the repro to just the following XAML:

    <Grid >
        <igWindow:XamWebDialogWindow Height="200" Width="200" >
            <igWindow:XamWebDialogWindow.Content>
                <igChart:XamWebChart>
                    <igChart:XamWebChart.Series>
                        <igChart:Series ChartType="Column" Label="Series 1">
                            <igChart:Series.DataPoints>
                                <igChart:DataPoint  Value="10" Label="point1" />
                                <igChart:DataPoint  Value="20" Label="point2" />
                            </igChart:Series.DataPoints>
                        </igChart:Series>
                    </igChart:XamWebChart.Series>
                </igChart:XamWebChart>
            </igWindow:XamWebDialogWindow.Content>
        </igWindow:XamWebDialogWindow>
    </Grid>

    Steps:

    1. App loads with normal window
    2. Maximize the window.  Note chart disappears, only legend remains.
    3. Normalize the window.  Legend disappears as well, even if you maximize again.

    This uses a column chart which seems to be the easiest to repro with, but I've seen it with Pie and other chart types as well.  You can also make it happen without the 200x200 if you play around resizing, etc. 

    I tried setting min width/height on the chart.  Toggling RefreshEnabled, manually calling Refresh(true) in SizeChanged.  Nothing seemed to help.  The window is resizing the chart correctly, since the Chart's SizeChanged event is firing.  But I can't seem to get in there and make the chart show up.

Reply Children