This repository has been archived by the owner on Oct 2, 2023. It is now read-only.
/
Form1.cs
49 lines (45 loc) · 1.47 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using DevExpress.XtraCharts;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace DesignerSample
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
dashboardDesigner1.CreateRibbon();
dashboardDesigner1.LoadDashboard(@"..\..\Data\T597206.xml");
}
private void dashboardDesigner1_DashboardItemControlCreated(object sender, DevExpress.DashboardWin.DashboardItemControlEventArgs e)
{
if (e.DashboardItemName == "chartDashboardItem1")
{
e.ChartControl.AxisScaleChanged += ChartControl_AxisScaleChanged;
}
}
private void ChartControl_AxisScaleChanged(object sender, AxisScaleChangedEventArgs e)
{
if (e.Axis is SecondaryAxisY)
{
if (e.GridSpacingChange.NewValue<1)
{
e.Axis.NumericScaleOptions.GridSpacing = 1;
}
}
}
private void dashboardDesigner1_DashboardItemBeforeControlDisposed(object sender, DevExpress.DashboardWin.DashboardItemControlEventArgs e)
{
if (e.DashboardItemName == "chartDashboardItem1")
{
e.ChartControl.AxisScaleChanged -= ChartControl_AxisScaleChanged;
}
}
}
}