回答編集履歴
1
見直しキャンペーン中
answer
CHANGED
@@ -1,75 +1,75 @@
|
|
1
|
-
> スタート地点を変えて左0度や右0度にしたり
|
2
|
-
> 左周りにしたりすることは出来ないのでしょうか?
|
3
|
-
|
4
|
-
元データは変えてはいけないという前提なんですよね?(いじっていいのならラベルを変えればどうにでもなってしまうので)
|
5
|
-
|
6
|
-
回転は、`IntervalOffset`等をあれこれいじっていたらできました。
|
7
|
-
|
8
|
-
反対周りは、`Polar`は`AxisX.IsReversed = true`が効かないようなので難しそうです。
|
9
|
-
|
10
|
-
[Axis.IntervalOffset プロパティ (System.Windows.Forms.DataVisualization.Charting) | Microsoft Docs](https://docs.microsoft.com/ja-jp/dotnet/api/system.windows.forms.datavisualization.charting.axis.intervaloffset)
|
11
|
-
[Axis.Maximum プロパティ (System.Windows.Forms.DataVisualization.Charting) | Microsoft Docs](https://docs.microsoft.com/ja-jp/dotnet/api/system.windows.forms.datavisualization.charting.axis.maximum)
|
12
|
-
[Axis.Minimum プロパティ (System.Windows.Forms.DataVisualization.Charting) | Microsoft Docs](https://docs.microsoft.com/ja-jp/dotnet/api/system.windows.forms.datavisualization.charting.axis.minimum)
|
13
|
-
|
14
|
-
```
|
15
|
-
using System.Windows.Forms;
|
16
|
-
using System.Windows.Forms.DataVisualization.Charting;
|
17
|
-
|
18
|
-
namespace Questions356436
|
19
|
-
{
|
20
|
-
public partial class Form1 : Form
|
21
|
-
{
|
22
|
-
public Form1()
|
23
|
-
{
|
24
|
-
InitializeComponent();
|
25
|
-
|
26
|
-
var panel = new TableLayoutPanel
|
27
|
-
{
|
28
|
-
Dock = DockStyle.Fill,
|
29
|
-
ColumnCount = 3,
|
30
|
-
};
|
31
|
-
panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F));
|
32
|
-
panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F));
|
33
|
-
panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F));
|
34
|
-
Controls.Add(panel);
|
35
|
-
|
36
|
-
|
37
|
-
var chart1 = new Chart { Dock = DockStyle.Fill, };
|
38
|
-
chart1.Titles.Add(new Title("ノーマル"));
|
39
|
-
chart1.ChartAreas.Add(new ChartArea());
|
40
|
-
chart1.Series.Add(new Series { ChartType = SeriesChartType.Polar, BorderWidth = 3, });
|
41
|
-
panel.Controls.Add(chart1, 0, 0);
|
42
|
-
|
43
|
-
var chart2 = new Chart { Dock = DockStyle.Fill, };
|
44
|
-
chart2.Titles.Add(new Title("右90度回転"));
|
45
|
-
chart2.ChartAreas.Add(new ChartArea());
|
46
|
-
chart2.Series.Add(new Series { ChartType = SeriesChartType.Polar, BorderWidth = 3, });
|
47
|
-
panel.Controls.Add(chart2, 1, 0);
|
48
|
-
|
49
|
-
var chart3 = new Chart { Dock = DockStyle.Fill, };
|
50
|
-
chart3.Titles.Add(new Title("左90度回転"));
|
51
|
-
chart3.ChartAreas.Add(new ChartArea());
|
52
|
-
chart3.Series.Add(new Series { ChartType = SeriesChartType.Polar, BorderWidth = 3, });
|
53
|
-
panel.Controls.Add(chart3, 2, 0);
|
54
|
-
|
55
|
-
|
56
|
-
for (var i = 0; i <= 360; i += 30)
|
57
|
-
{
|
58
|
-
chart1.Series[0].Points.AddXY(i, 10 + i / 30);
|
59
|
-
chart2.Series[0].Points.AddXY(i, 10 + i / 30);
|
60
|
-
chart3.Series[0].Points.AddXY(i, 10 + i / 30);
|
61
|
-
}
|
62
|
-
|
63
|
-
chart2.ChartAreas[0].AxisX.IntervalOffset = -90; // 直感と符号が逆
|
64
|
-
chart2.ChartAreas[0].AxisX.Minimum = -chart2.ChartAreas[0].AxisX.IntervalOffset;
|
65
|
-
chart2.ChartAreas[0].AxisX.Maximum = chart2.ChartAreas[0].AxisX.Minimum + 360;
|
66
|
-
|
67
|
-
chart3.ChartAreas[0].AxisX.IntervalOffset = -270;
|
68
|
-
chart3.ChartAreas[0].AxisX.Minimum = -chart3.ChartAreas[0].AxisX.IntervalOffset;
|
69
|
-
chart3.ChartAreas[0].AxisX.Maximum = chart3.ChartAreas[0].AxisX.Minimum + 360;
|
70
|
-
}
|
71
|
-
}
|
72
|
-
}
|
73
|
-
```
|
74
|
-
|
1
|
+
> スタート地点を変えて左0度や右0度にしたり
|
2
|
+
> 左周りにしたりすることは出来ないのでしょうか?
|
3
|
+
|
4
|
+
元データは変えてはいけないという前提なんですよね?(いじっていいのならラベルを変えればどうにでもなってしまうので)
|
5
|
+
|
6
|
+
回転は、`IntervalOffset`等をあれこれいじっていたらできました。
|
7
|
+
|
8
|
+
反対周りは、`Polar`は`AxisX.IsReversed = true`が効かないようなので難しそうです。
|
9
|
+
|
10
|
+
[Axis.IntervalOffset プロパティ (System.Windows.Forms.DataVisualization.Charting) | Microsoft Docs](https://docs.microsoft.com/ja-jp/dotnet/api/system.windows.forms.datavisualization.charting.axis.intervaloffset)
|
11
|
+
[Axis.Maximum プロパティ (System.Windows.Forms.DataVisualization.Charting) | Microsoft Docs](https://docs.microsoft.com/ja-jp/dotnet/api/system.windows.forms.datavisualization.charting.axis.maximum)
|
12
|
+
[Axis.Minimum プロパティ (System.Windows.Forms.DataVisualization.Charting) | Microsoft Docs](https://docs.microsoft.com/ja-jp/dotnet/api/system.windows.forms.datavisualization.charting.axis.minimum)
|
13
|
+
|
14
|
+
```cs
|
15
|
+
using System.Windows.Forms;
|
16
|
+
using System.Windows.Forms.DataVisualization.Charting;
|
17
|
+
|
18
|
+
namespace Questions356436
|
19
|
+
{
|
20
|
+
public partial class Form1 : Form
|
21
|
+
{
|
22
|
+
public Form1()
|
23
|
+
{
|
24
|
+
InitializeComponent();
|
25
|
+
|
26
|
+
var panel = new TableLayoutPanel
|
27
|
+
{
|
28
|
+
Dock = DockStyle.Fill,
|
29
|
+
ColumnCount = 3,
|
30
|
+
};
|
31
|
+
panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F));
|
32
|
+
panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F));
|
33
|
+
panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.33333F));
|
34
|
+
Controls.Add(panel);
|
35
|
+
|
36
|
+
|
37
|
+
var chart1 = new Chart { Dock = DockStyle.Fill, };
|
38
|
+
chart1.Titles.Add(new Title("ノーマル"));
|
39
|
+
chart1.ChartAreas.Add(new ChartArea());
|
40
|
+
chart1.Series.Add(new Series { ChartType = SeriesChartType.Polar, BorderWidth = 3, });
|
41
|
+
panel.Controls.Add(chart1, 0, 0);
|
42
|
+
|
43
|
+
var chart2 = new Chart { Dock = DockStyle.Fill, };
|
44
|
+
chart2.Titles.Add(new Title("右90度回転"));
|
45
|
+
chart2.ChartAreas.Add(new ChartArea());
|
46
|
+
chart2.Series.Add(new Series { ChartType = SeriesChartType.Polar, BorderWidth = 3, });
|
47
|
+
panel.Controls.Add(chart2, 1, 0);
|
48
|
+
|
49
|
+
var chart3 = new Chart { Dock = DockStyle.Fill, };
|
50
|
+
chart3.Titles.Add(new Title("左90度回転"));
|
51
|
+
chart3.ChartAreas.Add(new ChartArea());
|
52
|
+
chart3.Series.Add(new Series { ChartType = SeriesChartType.Polar, BorderWidth = 3, });
|
53
|
+
panel.Controls.Add(chart3, 2, 0);
|
54
|
+
|
55
|
+
|
56
|
+
for (var i = 0; i <= 360; i += 30)
|
57
|
+
{
|
58
|
+
chart1.Series[0].Points.AddXY(i, 10 + i / 30);
|
59
|
+
chart2.Series[0].Points.AddXY(i, 10 + i / 30);
|
60
|
+
chart3.Series[0].Points.AddXY(i, 10 + i / 30);
|
61
|
+
}
|
62
|
+
|
63
|
+
chart2.ChartAreas[0].AxisX.IntervalOffset = -90; // 直感と符号が逆
|
64
|
+
chart2.ChartAreas[0].AxisX.Minimum = -chart2.ChartAreas[0].AxisX.IntervalOffset;
|
65
|
+
chart2.ChartAreas[0].AxisX.Maximum = chart2.ChartAreas[0].AxisX.Minimum + 360;
|
66
|
+
|
67
|
+
chart3.ChartAreas[0].AxisX.IntervalOffset = -270;
|
68
|
+
chart3.ChartAreas[0].AxisX.Minimum = -chart3.ChartAreas[0].AxisX.IntervalOffset;
|
69
|
+
chart3.ChartAreas[0].AxisX.Maximum = chart3.ChartAreas[0].AxisX.Minimum + 360;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
```
|
74
|
+
|
75
75
|

|