Ticket T295873
Visible to All Users

Chart Data Source does not update after loading a workspace

created 9 years ago

Hello,

I have a ChartControl inside a LayoutPanel inside a DockLayoutManager.

Everything works fine, ie the chart data source is correctly bound and displays data, if I don't restore a work space.  As soon as I restore a workspace from a file the chart does not display any data.  The data source which is an observable collection of series points, contains data, but the diagram.series.points collection never updates and is always empty.  How can I fix this?  Thank you.

here is my chart

XAML
<dxc:ChartControl.Diagram> <dxc:XYDiagram2D x:Name="Diagram2D"> <dxc:XYDiagram2D.AxisX> <dxc:AxisX2D GridLinesVisible="True"> </dxc:AxisX2D> </dxc:XYDiagram2D.AxisX> <dxc:XYDiagram2D.Series> <dxc:BarSideBySideSeries2D x:Name="series" dx:DXSerializer.SerializationID="crmChartSeriesID" ArgumentDataMember="Argument" ValueDataMember="Value" ArgumentScaleType="Qualitative" DataSource="{Binding ChartData, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" AnimationAutoStartMode="PlayOnce"> <dxc:BarSideBySideSeries2D.Model> <dxc:Quasi3DBar2DModel /> </dxc:BarSideBySideSeries2D.Model> <dxc:BarSideBySideSeries2D.Label> <dxc:SeriesLabel ResolveOverlappingMode="Default" /> </dxc:BarSideBySideSeries2D.Label> </dxc:BarSideBySideSeries2D> </dxc:XYDiagram2D.Series> </dxc:XYDiagram2D> </dxc:ChartControl.Diagram> <dxc:ChartControl.Legend> <dxc:Legend /> </dxc:ChartControl.Legend> </dxc:ChartControl>

And here is how I am loading a workspace

C#
var workspaceManager = WorkspaceManager.GetWorkspaceManager(DockLayoutManager) as WorkspaceManager; workspaceManager.TransitionEffect = TransitionEffect.Dissolve; workspaceManager.LoadWorkspace("crmWorkspace", fileName); workspaceManager.ApplyWorkspace("crmWorkspace");

Answers approved by DevExpress Support

created 9 years ago

Hi Roni,

Since the data source is a complex object and cannot be serialized automatically, you will need to manually initialize the chart's data source after restoring the workspace from a file. Please update your source code accordingly and let us know if you need any clarification.

    Show previous comments (8)
    DevExpress Support Team 9 years ago

      Hi Roni,

      After the chart layout is restored, mouse events are not processed correctly because actual chart entities (e.g., Legend) are different from instance names referenced in your code. I have modified your example to illustrate how to access actual diagram layout items (Panes, Legend, X-Axis) at runtime. We will also continue working on the VisibilityInPanes issue and update the corresponding ticket status once we find a permanent solution. Let me know if you need further assistance. I will be happy to help you.

        This works, Thank you very much Alex

        DevExpress Support Team 9 years ago

          You are always welcome, Roni!

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.