Note that there are some explanatory texts on larger screens.

plurals
  1. POusing a chart with values from textboxes
    primarykey
    data
    text
    <p>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. </p> <p>The problem is where to assign the text box's as values.</p> <ul> <li>Is it done in code? if so what do I call?</li> <li>Is it done in the control properties? if so what do I do?</li> <li>Is it a bit of both? is so, well same as both above.</li> </ul> <p>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.<br/> I'm hoping this is a really simple process I'm overlooking.<br/></p> <p>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)</p> <p>this is some code ive tried</p> <pre><code> 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); </code></pre> <p>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</p> <p>::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?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload