public SimpleArrangerSample() { InitializeComponent(); // first layer with automatic label positioning var arranger = new SimpleArranger(); lbls = new ChartLabels() { LabelArranger = arranger }; chart.View.Layers.Add(lbls); // second layer with user-movable labels lbls2 = new ChartLabels(); chart.View.Layers.Add(lbls2); lbls2.LayoutUpdated += new EventHandler(lbls2_LayoutUpdated); NewData(5); chart.Actions.Add(new ZoomAction()); chart.Actions.Add(new TranslateAction() { Modifiers = ModifierKeys.Shift }); chart.Actions.Add(new ScaleAction() { Modifiers = ModifierKeys.Control }); chart.MouseLeftButtonDown += new MouseButtonEventHandler(chart_MouseLeftButtonDown); }
private void ReBuild(DiagramDTO diagram) { ChartBuilder cb = new ChartBuilder(); cb.BuildFromDiagram(diagram); if (!diagram.IsAdjusted) { var arranger = new SimpleArranger(); arranger.Arrange(cb.Items, cb.Connections); } SetItems(cb.Items); SetConnections(cb.Connections); }