mschart

Lock MSChart Gridlines

六月ゝ 毕业季﹏ 提交于 2019-12-06 14:21:20
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. 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 will automatically do a best-fit interval between your declared min and max, thus potentially changing the

C# MS Chart Control - two questions

折月煮酒 提交于 2019-12-06 13:22:34
So I've made this range bar chart with the MS Chart Control. I have two questions: How can I implement an event handler for when the user double clicks a series? I can't see one anywhere. For some reason the scrollbar on my X Axis (which, amusingly, the Chart Control seems to think is the Y Axis...) seems to be partially transparent for some reason...can anyone shed any light as to why that might be? Here's my code so far, bastardised from a PDF I found somewhere on the net (yeah, I know, it's messy, needs tidying up): private void PopulateGantt() { foreach (Job jobThis in lstJobs) { if (

How do you use the Zooming UI in MSChart for .Net

≯℡__Kan透↙ 提交于 2019-12-06 12:57:59
I have just started looking at potentially using the MSChart control for .Net 3.5 for a project that will be starting shortly. One of the requirements of the project is that the users be able to zoom into the charts to see small data points more clearly when necessary. I have looked at a number of tutorials and the either do not mention zooming, or just give a brief bit of information about how to enable it and seem to assume that using it is so obvious that it requires no explanation. I created a quick test project, added the control to the form, and then added a few Points to the default

How to do aligned scrolling through two chart areas without using AlignToChartArea?

醉酒当歌 提交于 2019-12-06 12:43:33
I have two ChartArea objects in a Chart ( System.Windows.Forms.DataVisualization.Charting is what I'm using). One is a Point graph, and the other is a RangeBar graph. The horizontal axis on the RangeBar graph is actually the Y axis, so I cannot just use something like this: Chart1.ChartAreas["Chart Area 2"].AlignWithChartArea = "Default"; I've figured out how to zoom both charts and keep them aligned, but when I try to scroll both charts by clicking on the scrollbar on one of the horizontal axes, I can't quite get it to line up. They almost line up, but they're off by maybe a second or so (the

How does one set an image as or along a chart axis?

感情迁移 提交于 2019-12-06 05:28:56
问题 I am trying to use a colored spectrum strip as an axis for a chart. The idea is to match the color on the image with its associated wavelength along the x-axis at the bottom. The strip needs to change in size to match changes of the chart area and expand and contract sections to match scroll-zooming in the chart area. I have tried using image annotations but as the chart area changes, the annotation dimensions remain fixed. Also, the scroll zooming that focuses in on mouse position obviously

ASP.NET Chart control set month names from int value on X Axis labels

大憨熊 提交于 2019-12-06 03:24:00
I want to replace numbers (1, 2, 3, ...) on the X Axis of the chart with the corresponding month name. This is my actual chart: On the DataView that populates the Series I have the "MONTH" column that contains values from 1 to 12. I also had to manually set the Minimum and Maximum value to 0 and 13, otherwise I lose the first and last column because of a lack of space between the beginning of the first X Axis column and the Y Axis and between the last X Axis column end of Chart area. <ChartAreas> <asp:ChartArea Name="ChartArea1"> <AxisX IsStartedFromZero="True" Title="Mese" TitleFont="Segoe UI

How to modify C# Chart control chartArea percentages

女生的网名这么多〃 提交于 2019-12-05 22:37:22
问题 If I have a chart control with 2 chartAreas in it, the chart control by default puts the chartAreas on top of each other makes each area take 50% of the available size of the chart control. Is there a way to change the chartAreas' percent so that I could say, have the top chart take 75% of the area, and the bottom chart take 25%? 回答1: So, I eventually found it, but I do not think that it is very well documented. There each chartArea has the property ChartArea.Position. This property of the

Algorithm for scatter plot 'best-fit' line

試著忘記壹切 提交于 2019-12-05 22:13:09
问题 I'm writing a small application in C# using MSChart control to do Scatter Plots of sets of X and Y data points. Some of these can be rather large (hundreds of data points). Wanted to ask if there's a 'standard' algorith for plotting a best-fit line across the points. I'm thinking to divide the X data points to a predefined number of sets, say 10 or 20, and for each set take the average of the corresponding Y values and the middle X value, and so on to create the line. Is this a correct

How to set chart type to pie

亡梦爱人 提交于 2019-12-05 05:47:19
When I do it without putting chart type is working fine but when I set it to pie its not working correct. It put all series name as Point 1 the pie is only 1 blue piece (one circle) and it show only first point (Value). foreach (var tag in tags) { HtmlNode tagname = tag.SelectSingleNode("a"); HtmlNode tagcount = tag.SelectSingleNode("span/span"); chart1.Series.Add(tagname.InnerText); chart1.Series[x].Points.AddY(int.Parse(tagcount.InnerText)); chart1.Series[x].IsValueShownAsLabel = true; chart1.Series[x].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie; x++; }

C# Setting FontDialog to only display TrueType fonts

假如想象 提交于 2019-12-05 04:50:35
This question has been asked in practically every forum, including here but there are no acceptable answers anywhere that I can find. I'm beginning to think that there is actually no solution and I just have to wrap my code in a try/catch block and apologise to the user and ask them to pick another font. I want to show a FontDialog so that a user can change the fonts on a Chart , however if the user selects a non-TrueType font, then an exception is thrown. GDI+ can only handle TrueType fonts. How can I filter the fonts from the FontDialog which cannot be used with GDI+? The FontDialog class