mschart

Get Y value across .NET chart series from X value

隐身守侯 提交于 2019-12-23 10:11:30
问题 using C# with .NET chart. I am trying to graph several waveforms, and I wish to move my mouse across the chart area, and have my tooltip display the Y value of each series in the chart at this X value location. | at xValue 12 | | | _ = 3 | | | * = 2 | * * | | ________|______________________________*_____ | | / | * | | __________*/*********|***************************** | | * | | | * | | |______________________|_____________________________________| Kind of like this diagram above. Below is a

MS Chart: How can you change the color of each label on the Axis of a Bar Chart?

人走茶凉 提交于 2019-12-23 09:12:50
问题 I have a bar chart which shows different categories on the Y axis. I can change the color of all of them on the axis at the same time by using: chart.ChartAreas["MyChart"].AxisY.LabelStyle.ForeColor = "Red"; However it doesn't allow me to set the color for each of them. Any help will be much appreciated. 回答1: You can try adding custom labels to the chart, and that will allow you to modify each one individually. private void AddCustomLabelAtYValue(double YValue, string Text, Color ForeColor) {

Multiple y-axis background colors for chart

依然范特西╮ 提交于 2019-12-23 05:15:58
问题 How can I create a background for a chart that looks like this? It's got different background colors at certain % levels that correspond to the status. All I see in ChartArea is BackColor , BackSecondaryColor , and BackGradientStyle which won't do this. This image was taken from an SSRS report and I am trying to recreate it using C# and the Microsoft charting library. I am pretty sure SSRS uses the same library so it should be possible - I just don't know how. 回答1: You can achieve this by

Lock MSChart Gridlines

扶醉桌前 提交于 2019-12-22 18:30:02
问题 How do I do the following with an MSChart? Set axes to x: [0 - 1000] and y: [0 - 1]. Show the gridlines when chart has no points. Disable auto adjusting of gridlines. Note: Setting Axis(X/Y).(Min/Max)imum seems to have no effect if a point exists inside the bounds. 回答1: Question 1) is nicely answered by Bentley Davis, by setting the min and max values of the X and Y axes. Question 3) requires one more property for each axis; the .Interval property. If you do not set the Interval, the MSChart

Lock MSChart Gridlines

余生颓废 提交于 2019-12-22 18:29:02
问题 How do I do the following with an MSChart? Set axes to x: [0 - 1000] and y: [0 - 1]. Show the gridlines when chart has no points. Disable auto adjusting of gridlines. Note: Setting Axis(X/Y).(Min/Max)imum seems to have no effect if a point exists inside the bounds. 回答1: Question 1) is nicely answered by Bentley Davis, by setting the min and max values of the X and Y axes. Question 3) requires one more property for each axis; the .Interval property. If you do not set the Interval, the MSChart

How to change chart series color

末鹿安然 提交于 2019-12-22 06:58:48
问题 I have a single series which populates my chart with records from a database. Seven records are been displayed but in the sanme color. I' trying to change each bar color without success Below are the lines i tried but i gave me one big green bar (: private void button1_Click(object sender, EventArgs e) { /*First empty the chart2 to fire the current data*/ if (cbChart.SelectedItem == null) { chart.Visible = false; chart.Controls.Clear(); } else //pnchart.Controls.Clear(); chart.Visible = true;

Definitive list of all available CustomProperties for Series and DataPoint in MSChart

牧云@^-^@ 提交于 2019-12-21 04:06:23
问题 I am working with the .NET 3.5 MSChart controls and from time to time I find that I need to add custom properties to either the Series or DataPoints. For example: Series series = new Series(); series["PieDrawingStyle"] = "SoftEdge"; DataPoint point = new DataPoint(); point["Exploded"] = "true" point["PieLabelStyle"] = "Disabled"; All of the custom properties I use I have found about from the Web Samples project provided by Microsoft, sometimes from the source given in the samples, sometimes

Display HH:mm:ss in DateTime x axis in Chart C#

隐身守侯 提交于 2019-12-20 04:52:44
问题 I have series of data (temperature vs time) and I want to plot it using Chart object of .NET 4.0. The problem is that if I choose DateTime as the XValueType for the series it is displayed like dd.mm.yyyy but I want to display it as HH:mm:ss . How can I do that? Thanks for your help 回答1: Solution 1: Try This: DateTime myDateValue = DateTime.Now; String XValueType = myDateValue.ToString("HH:mm:ss"); Solution 2: if you are using windows chart control then Try This: chart1.ChartAreas["ChartArea1"

Binding datareader to asp chart control

主宰稳场 提交于 2019-12-20 03:33:12
问题 Essentially I have a datareader that in theory will call a storedprocedure, and bind the query that is returned to a chart. This is the data that I'd like to be bound to a chart: ForecastDesc Previous Current Budget Forecast 4 Forecast 7 Period1 966025.79 1466872.95 1000000.00 0.00 0.00 Period2 1051175.09 1489785.15 1000000.00 0.00 0.00 Period3 1205352.26 1552806.49 1000000.00 0.00 0.00 Period4 1261483.84 1544562.06 1000000.00 50.00 0.00 Period5 1298918.58 1681396.55 1000000.00 45.00 0.00

Convert chart coords to pixels

天涯浪子 提交于 2019-12-20 03:07:22
问题 I should draw a circle inside a polar chart with some text on it. I started to play with PostPaint, got chart graphics, so I am able to draw and write custom things on it. My main problem is the placement. E.g. I'd like to draw sg where my x and y axes are crossing, but I did not find any effective way to convert graph coordinates (in my example 0,0) to pixel coordinates. How can I do this? How can I convert chart coords to pixels? .net4/winforms/vs2010/c# 回答1: So, I solved it. I handle