mschart

How to align two (or more) charts in size, scroll and grid

a 夏天 提交于 2020-02-13 05:46:27
问题 I have three signals (volgate, current, and energy) referred to the same period. I print data on two graphs: one with voltage (blue) and current (red) and the other with only energy (orange). They are two different graphs, but in practice, they share the same X-axis. I have two cursor synchronized with the mouse movement that is acting as one cursor for the two graphs and a tooltip based on cursor position shows the currently selected values for the three signals (all the three series have

How to Fix the X Axis values length in Microsoft chart controls

Deadly 提交于 2020-01-25 08:25:06
问题 In My sample, I make the X axis to rotate to -90. Now the label values are vertical. Some of the values are huge like "Sample Quotes". Due to this huge values, My label area is increased and chart area is decreased. Is it possible to fix the X axis label length in Microsoft chart controls? 回答1: I got the answer for this question. This is possible by MSChart.ChartAreas[0].AxisX.LabelAutoFitStyle = LabelAutoFitStyles.WordWrap; MSChart.ChartAreas[0].AxisX.IsLabelAutoFit = true; Regards, Karthik

Interactive Chart with MS Chart Control VB

半世苍凉 提交于 2020-01-24 23:30:15
问题 Hi I'am currently creating a Chart to and img and display it in view. But I would like to make it a little more interactive ... eg. when user put mose over point (in point chart) he can see the values of this point. Here I create and image of an chart Function GenerateChart(id As Integer, width As Integer, height As Integer) As ActionResult ' Creating chart Dim chart = New Chart() Dim area = New ChartArea() Dim series = New Series() chart.Width = width chart.Height = height ' Adding Series to

Changing datetime format on mschart axis

喜你入骨 提交于 2020-01-22 19:13:07
问题 I'm using mschart to display some values over a timeperiod. It looks something like this: As you can see the first value is from 15:11 and the last from 16:10 But on the x-axis it's on displaying the days. How can I change this? EDIT: Changing XValueType to ChartValueType.Time leads to this: 回答1: To show DateTime related values on the XAxis you can choose to set the XValueType property. In your case Series[0].XValueType = ChartValueType.Time would be the right thing to display time related

Changing datetime format on mschart axis

感情迁移 提交于 2020-01-22 19:12:10
问题 I'm using mschart to display some values over a timeperiod. It looks something like this: As you can see the first value is from 15:11 and the last from 16:10 But on the x-axis it's on displaying the days. How can I change this? EDIT: Changing XValueType to ChartValueType.Time leads to this: 回答1: To show DateTime related values on the XAxis you can choose to set the XValueType property. In your case Series[0].XValueType = ChartValueType.Time would be the right thing to display time related

Logarithmic Vertical and Horizontal Axes lines in MS Chart Control

余生颓废 提交于 2020-01-20 08:34:08
问题 The image presents a logarithmic graph. I want to create a similar graph using MS Chart control. I know there is a way to convert normal graph to logarithmic graph but i am not able to create vertical and horizontal axes lines (light gray in color) similar to the graph below. 回答1: You could try to set the chart's axes IsLogarithmic property to true and set up their MinorGrid as follows: private static void SetupAxis(Axis axis) { // Set the logarithmic scale mode: axis.IsLogarithmic = true; //

Logarithmic Vertical and Horizontal Axes lines in MS Chart Control

一个人想着一个人 提交于 2020-01-20 08:31:45
问题 The image presents a logarithmic graph. I want to create a similar graph using MS Chart control. I know there is a way to convert normal graph to logarithmic graph but i am not able to create vertical and horizontal axes lines (light gray in color) similar to the graph below. 回答1: You could try to set the chart's axes IsLogarithmic property to true and set up their MinorGrid as follows: private static void SetupAxis(Axis axis) { // Set the logarithmic scale mode: axis.IsLogarithmic = true; //

ASP.NET Pie chart only displaying YValueMembers

无人久伴 提交于 2020-01-15 10:13:17
问题 I am trying to create a chart to display the percentage of checked and unchecked answer booklets.But the pie chart is only showing the unchecked value which is the YValueMember. How to resolve this? protected void DropDown_Subjects_SelectedIndexChanged(object sender, EventArgs e) { Chart4.Visible = true; SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Con"].ConnectionString); SqlCommand cmd = new SqlCommand("select checked_percent, unchecked_percent From

How reduce the height of an mschart by breaking up the y-axis

≡放荡痞女 提交于 2020-01-15 04:57:14
问题 How can I reduce the height of an mschart like this: [EDIT] In my case I do not want break chart view. this.chart1.ChartAreas[0].AxisY.ScaleBreakStyle.Enabled = false; 回答1: You seem to be looking for AxisY.ScaleBreakStyle . Here is an example: Series s = chart1.Series[0]; ChartArea ca = chart1.ChartAreas[0]; Axis ay = ca.AxisY; s.ChartType = SeriesChartType.Line; for (int i = 0; i < 100; i++) s.Points.AddXY(i, rnd.Next(100) + 50 ); s.Points.AddXY(s.Points.Count, 123456); ay.ScaleBreakStyle

Get Mouse click event from Microsoft Chart Control click on data marker

北城以北 提交于 2020-01-13 05:56:26
问题 I have a .net 4.0 point chart in my app. I would like to capture the mouse click on a data marker. When the user clicks on a particular point, I'd like to go to the row in the bound table where the data came from. Is this functionality built-in to the .net chart control? EDIT: I found that I may have actually wanted the cursor position value rather than requiring the user to click on a specific data point. Once I have the cursor location, that value can be used to find the row in the dataset