问题
I am very new to ASP.NET charting tools. I have a data table at hand which contains 10 series (QOL-1 to QOL-10). These 10 items are asked in one questionnaire all together on multiple dates. So for each date, there will be 10 answers collected. I would like to plot a 3D column chart to show the answers for each question on each date, where the X-axis indicates dates that data was collected, Y-axis indicates the answer, and Z-axis indicates the item labels (QOL-1 to QOL-10).
However, I am not sure how to add this Z-axis.
This is what I have for now
And I want to achieve:
This is what I want to achieve for Z-axis
I also attached my code:
C#:
QoLChart.DataBindCrossTable(qol_data.DefaultView, "label", "Date", "Value", "");
QoLChart.DataBind();
QoLChart.ChartAreas["ChartArea3"].Area3DStyle.Enable3D = true;
QoLChart.ChartAreas["ChartArea3"].Area3DStyle.IsClustered = false;
QoLChart.ChartAreas["ChartArea3"].Area3DStyle.Perspective = Convert.ToInt32(PerspectiveBox.Text.ToString());
QoLChart.ChartAreas["ChartArea3"].Area3DStyle.Inclination = Convert.ToInt32(InclinationBox.Text.ToString());
QoLChart.ChartAreas["ChartArea3"].Area3DStyle.Rotation = Convert.ToInt32(RotationBox.Text.ToString());
QoLChart.ChartAreas["ChartArea3"].Area3DStyle.PointDepth = Convert.ToInt32(PointDepthBox.Text.ToString());
QoLChart.ChartAreas["ChartArea3"].Area3DStyle.PointGapDepth = Convert.ToInt32(GapDepthBox.Text.ToString());
QoLChart.ChartAreas["ChartArea3"].AxisY.Minimum = 0;
QoLChart.ChartAreas["ChartArea3"].AxisY.IntervalAutoMode = IntervalAutoMode.VariableCount;
QoLChart.ChartAreas["ChartArea3"].AxisX.Interval = 1;
QoLChart.ChartAreas["ChartArea3"].AxisY.Interval = 1;
QoLChart.ChartAreas["ChartArea3"].AxisX.LabelStyle.Angle = 45;
aspx:
<asp:Chart ID="QoLChart" runat="server" Height="800px" Width="1200px" Palette="None"
PaletteCustomColors="LightSteelBlue; Thistle; Plum; Orchid; MediumOrchid; DarkOrchid; Purple; Indigo">
<ChartAreas>
<asp:ChartArea Name="ChartArea3" BackColor="White">
<AxisY>
<LabelStyle Font="Trebuchet MS, 12pt" />
<MajorGrid LineColor="White" />
<MinorGrid LineColor="Blue" />
</AxisY>
<AxisX>
<LabelStyle Font="Trebuchet MS, 12pt" />
<MajorGrid LineColor="64, 64, 64, 64" />
</AxisX>
</asp:ChartArea>
</ChartAreas>
<Legends>
<asp:Legend Name="Legend3">
</asp:Legend>
</Legends>
</asp:Chart>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"></asp:ObjectDataSource>
</td>
</tr></table>
</asp:Content>
来源:https://stackoverflow.com/questions/61377441/create-a-3d-column-chart-using-asp-net-how-to-add-z-axis