Unable to draw the graph when all the y coordinates have the same value

7 views
Skip to first unread message

Shivam

unread,
May 17, 2012, 5:13:42 AM5/17/12
to coreplot-discuss
I am using the simple "Control chart" of the PlotGallery example from
CorePlot library to draw the graph in my application, When all Y-
coordinates have the same value its not plotting the graph.Please let
me know, What changes i should do to comply this. I am plotting a
graph for the dynamic data. Where both X and Y coordinate values are
dynamic.

Eric

unread,
May 17, 2012, 6:51:42 PM5/17/12
to coreplot...@googlegroups.com
Are you using -scaleToFitPlots: to adjust the plot ranges? Make sure that both plot ranges have a non-zero length.

Eric

Shivam

unread,
May 18, 2012, 12:51:46 AM5/18/12
to coreplot-discuss
Hi Eric,

Thanks for responding to my query.

Yes i am using scaleToFitPlots. Both the plot ranges has the non zero
values. In PlotGallery sample where they form the data to plot i.e in
GenerateData:
Add the same valid Y value (let us say 20) for the diff x values, then
u will see that no graph is plotted. where we expect it to draw a
horizontal line.

Please let me know if any thoughts on the same.

Shivam

Eric

unread,
May 18, 2012, 9:14:46 PM5/18/12
to coreplot...@googlegroups.com
-scaleToFitPlots: doesn't change the corresponding range if the plot returns a range with length zero. As long as your control lines are separated from each other, you can use [plotSpace scaleToFitPlots:[graph allPlots]]; to scale the plot to fit all of the plots including the control lines.

Eric
Reply all
Reply to author
Forward
0 new messages