Using a chart with values from text boxes
source link: https://www.codesd.com/item/using-a-chart-with-values-from-text-boxes.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Using a chart with values from text boxes
I'm trying to make a pie chart that uses values from a user from text box's. I'm using c# windows forms chart control.
The problem is where to assign the text box's as values.
- Is it done in code? if so what do I call?
- Is it done in the control properties? if so what do I do?
- Is it a bit of both? is so, well same as both above.
I've attempted to make one using the properties wizard but I cant see where to assign the values for it to process, the data source seem to only allow objects and connections to Dbos.
I'm hoping this is a really simple process I'm overlooking.
Yes I've checked MSDN but not a lot of info on the specifics I require. Yes I've checked google but again there is either no info or info on building my own from scratch (which I have done, but looks really bad)
this is some code ive tried
double[] yValues = { 10, 8, 7, 12};
string[] xNames = { "Greater than 200", "Between 200-100", "Between 100-50", "Below 50" };
chart1.Series[0].Points.DataBindXY(xNames, yValues);
chart1.Series[1].Points.DataBindXY(xNames, yValues);
chart1.Series[2].Points.DataBindXY(xNames, yValues);
chart1.Series[3].Points.DataBindXY(xNames, yValues);
it errors at series[2], saying the index was out of range. Im guessing it something to do with how the chart is currently set up
::UPDATED:: Ok so i was right i didnt assign enough series to the chart (silly me). Ive managed to get it up and running.....unfortunatly the image display looks like.....a letter(wierd). Its a box with a cross in the middle all equal aswell. I would at least think its would display proportional to the values i sent. so is this a set up OR is there something im doing wrong in my code?
I would suggest something like this. Where you would plug your y values directly from your textboxes.
double[] yValues = { 10, 27.5, 7, 12, 45.5};
string[] xNames = { “Mike”, “John”, “William”, “George”, “Alex” };
myChart.Series[0].Points.DataBindXY(xNames, yValues);
Recommend
-
9
AWS Tutorial 22 - Making Your Boxes Pingable Nov 6, 2016 The security default for AWS is brilliantly simple: Everything, absolutely everything, is locked down by default. Once you understand...
-
10
AWS Tutorial 08 - Using SSH's Config File with Your AWS Boxes Sep 20, 2016 Disclaimer: If you're a hard core Unix head then this can easily be skipped. However if your knowledge of SSH extends to "config file...
-
6
Introduction Dialog boxes are a commonly used GUI element to provide feedback to the user and also to prompt the user for information or to take an action. Some examples of common dialogs are: A simple message: "Press O...
-
10
Thank you for not needlessly reinstalling customer boxes I love the little nuggets of folklore which sometimes get passed around tech support centers. Some of them have no connection to reality, but they still manage to bounce ar...
-
8
Retrieving Values for 3D Bar Chart Component Monday, August 11, 2003 A question was posted to my weblog asking how to retrieve the data for the individual bar chart section selected in the 3D Bar chart included as part...
-
31
How to get text box values from gridview using jquery advertisements How to textbox values from gridview on click of a linkbutton using jque...
-
5
Replace the Placeholders in a Text With the Values of the ObjectSeptember 9th 2022 new story4
-
5
text-emphasis-position does not support optional leftUser Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:105.0) Gecko/20100101 Firefox/105.0 Steps to reproduce: Logged here:
-
11
Helm Upgrade: Update Chart Values – Example When you upgrade a Helm chart in a Kubernetes cluster you can also customize parameters of the chart to configure a release. The Helm chart parameters customiza...
-
4
In this article, we will learn how to show values on top of bars for a chart using the ChartJS CDN library. Approach Use the
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK