Stop .Net Chart (DataVisualization) From ReSizing To Tiny Chart? - vb.net

I have a chart that has strings for its x axis (a list of names). It's linked to a dynamic array, I have a problem where the graph resizes itself and squeezes 14-15 strings from the array and makes the bar chart small and tiny.
How can I achieve chunky bars and a scroll bar to scroll down to see the rest of the data even when new values are being added to the x-axis at runtime.
Have spent an hour searching with no help! =[
Edit:
Setting the PixelPointWidth Property to 300 gave me the width of the bar the way I want to be, but it has bunched the bars so that all the bars of the 4 series are overlapping instead of being side by side. WHere to go from here?
Edit2:
Manipulating the charts height is definitely getting the desired results, the only thing is the bigger the height, the more white space at the top of the chart, whats the fix for that,. and a fix for the Series representations to be "frozen" on scroll.

You can set the width of the chart every time you add new data to it:
Dim barWidth = Double.Parse(Chart1.Series(0)("PixelPointWidth"))
Chart1.Width = CInt(nData * barWidth) + 100
where nData is how many points there are and the 100 is some amount to take into account the space needed for the Y-axis labels and the legend.
Place the chart control in a Panel as suggested by jmcilhinney with AutoScroll set to true, and you will get a scrollbar when the width of the chart exceeds the width of the panel.
If you want the chart to show the latest added data, you can set the horizontal scroll position after setting the width of the chart:
Panel1.HorizontalScroll.Value = Panel1.HorizontalScroll.Maximum

Related

Use free space after hiding axis

I have a horizontal bar chart where I decided to hide the Y axis and display the axis labels inside the chart:
Now I'd like to know how I can tell Dimple to use the free space (see red rectangle) available from hiding the Y axis.
You set the bounds of the plot area with setMargins or setBounds. Dimple doesn't automatically size to accommodate axes. So just set the left margin to about 10px.

core plot stacked graph crossing top border

I'm trying to create a stacked graph using core plot.i have followed this tutorial.I have a UISlider on sliding i'm updating my graph.The issue i'm facing is my top value for y-axis is touching top border(As in the screen shot). As per my requirement in need to round off the highest value to next 10th value so that my graph doesn't touch the borders.On changing my slider value the x and y axis should also get refresh,i'm doing it by regenerating plot but it takes a lot of memory.Any idea how can i achieve these requirement ?
Don't recreate the whole graph every time the values change. Call -reloadData on the graph to refresh the plot data and set the xRange and yRange of the plot space to change the scale of the axes.

Setting Axis Label offset in core plot

After setting the bar offset , the axis labels are not displaying at the center of the bar and getting misplaced. Can any one help me with this ??
The barOffset moves the centers of the bars away from the bar locations provided by the datasource. If the axis labels are at the bar locations, they won't line up with the bars.
Possible solutions:
Set the barOffset to zero (0).
Change the axis labeling policy to place the labels under the bars. This will also move any tick marks on the axis unless you make custom labels.

How to zoom only a particular slice in pie chart (CorePlot ios) and not the entire piechart

How to zoom only a particular slice in pe chart (CorePlot iOS) and not the entire piechart on user interaction.
I know the following method gives the slice touched:
-(void)pieChart:(CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)index
but i want to zoom only that slice ?
You can "explode" the selected slice. Implement the -radialOffsetForPieChart:recordIndex: method in your datasource and return a positive offset for the selected slice to make it pop out from the rest of the pie.
You can use the -sliceFillForPieChart:recordIndex: datasource method to control the fill for each slice. This would allow you to adjust the color and/or transparency to highlight the selected slice.
If you want to make the selected slice larger than the others, use a second pie chart to display the selected slice. Use the same plot data for both plots. On the first one, use the normal slice fill for all but the selected slice, which could be transparent. Reverse that pattern for the second plot, i.e., all slices transparent except the selected one.
You said like below...
If you want to make the selected slice larger than the others, use a second pie chart to display the selected slice. Use the same plot data for both plots.
I need like this concept.I am selecting one slice from outer pie chart and need to load that selected slice value in second pie chart, and make some effects. How to load that value in second chart.Sample code is very handful.

Adding More Tick Labels To ZedGraph Axis?

I have tick labels on about every 4 ticks. This is great, but I want labels on every single tick, and I want to say that each tick should be an hour apart.
How can I accomplish this?
Edit properties of the Scale of your XAxis:
to change the gap between ticks edit the MinorStep and MajorStep properties. For both, use the value that corresponds to your one-hour-gap.
to display labels at every tick, AFAIR you should set IsPreventLabelOverlap to false.
try also editing MajorTic and MinorTic of your XAxis
Remember to call AxisChange() method and Invalidate() or Refresh() in order to refresh your graph with new scale settings.
If you have long labels, it is also useful to set the Angle property of FontSpec to 90 to draw long labels vertically, instead of horizontally (it saves a lot of space).
More info:
http://zedgraph.sourceforge.net/documentation/html/T_ZedGraph_Scale.htm