How to create a core plot click bar?

Asked By 40 points N/A Posted on -

Hello experts,

How to create a core plot click bar?

I am developing a webpage or website for my game forum project.

I need to add a core plot like click bar in my home page, how would I be able to do that?

Can you share with me some coding technique?

An html or PHP code will do as long as it will work.

Thank you.



Answered By 0 points N/A #136114

How to create a core plot click bar?



Check the app’s interface and include an object of BarPlotViewController, as property. We will call this barPlotViewController.

On the app’s, Please observe the following:

1) Combine barPlotViewController.
2) Set it as the root controller on the window.
3) Abide by good memory management practice by releasing it inside dealloc.

It is important  to understand that the most important class used is the CPTXYGraph  which holds all the components of a graph: a set of axes, frame for the graph, draw the graph on and the plot drawing . “Host” the graph, so that it can be displayed on the screen. This functionality is given by the CPTGraphHostingView class.

Set BarPlotViewController as a CPTBarPlotDataSource as well as a CPTBarPlotDelegate.  Add 3 properties: data, graph and hostingView .  Add the function generatePlot where you will create the bar graph.

Next, generate the data in in it With NibName

Now add the function generatePlot and copy-paste code in it.

First, we create the hostingView to hold the graph. Next, we create the graph itself and add it to hostingView.

Lastly, make an actual CPTBarPlot and include it to graph.

The last thing you have to do is implement some CPTBarPlotDataSource andCPTBarPlotDelegate methods so that the plot collects data correctly. Add these methods to BarPlotViewController. one at a time:

1) The first method helps set the number of bars in the plot.

2) The second one defines each bar’s height and location. These have also been defined in the array data.

3) Set a label for each bar.

4)  Add one last method.

Login/Register to Answer

Related Questions