serie rotulos posicion porcentaje poner nombre grafico etiquetas etiqueta dispersion datos barras agregar iphone core-plot

iphone - rotulos - posicion de etiqueta excel



¿Cómo eliminar el borde alrededor de un gráfico de núcleo de trazado? (7)

Estoy tratando de eliminar el borde alrededor de un gráfico de trama central en el iPhone, pero parece que estoy teniendo problemas con lo que debería ser simple en mi mente.

¡Punteros por favor!


Debería poder anular el estilo BorderLineStyle en plotArea del gráfico para eliminar el borde:

graph.plotAreaFrame.borderLineStyle = nil; // don''t draw a border

También puede crear su propio tema, utilizando los que están en el marco como ejemplos, y simplemente no establecer el borderLineStyle en eso.


En CorePlot 1.0, la estructura de CPTGraph ha cambiado ligeramente. El código para eliminar la línea de borde de un gráfico, asumiendo que el graph es de tipo GPTGraph o una subclase de CPTGraph , es

graph.plotAreaFrame.borderLineStyle = nil;


La forma correcta con borderLineStyle = nil después de applyTheme:

CPTGraph *graph = [[CPTXYGraph alloc] initWithFrame:hostView.bounds]; // Set padding for plot area [graph applyTheme:[CPTTheme themeNamed:kCPTPlainWhiteTheme]]; graph.plotAreaFrame.borderLineStyle = nil;


Ninguna de las respuestas funcionó para mí. Esto hizo el trabajo:

graph.paddingLeft = 0; graph.paddingRight = 0; graph.paddingTop = 0; graph.paddingBottom = 0; graph.plotAreaFrame.borderWidth = 0; graph.plotAreaFrame.cornerRadius = 0;


OK, descubrí cómo hacerlo, ¡bastante simple en realidad!

CPLineStyle *borderLineStyle = [CPLineStyle lineStyle]; borderLineStyle.lineColor = [CPColor whiteColor]; borderLineStyle.lineWidth = 1.0; graph.plotArea.borderLineStyle = borderLineStyle;

donde gráfico es tu objeto gráfico, la razón por la que tenía un borde en primer lugar era porque usaba CPPlainWhiteTheme.

Espero que esto ayude a los demás, ¿hay una mejor manera?


Puede establecer cualquier estilo de línea en nil . Esto hará que la línea no se dibuje en absoluto.


Si, como yo, está buscando no solo eliminar la línea de borde, sino también hacer una trama que ocupe toda la vista de alojamiento, la answer de Thomas Johannesmeyer me puso en el camino correcto.

Esto es lo que hice:

CPTGraphHostingView* hostingView = [[CPTGraphHostingView alloc] initWithFrame: frame]; CGRect bounds = hostingView.bounds; CPTGraph *graph = [[CPTXYGraph alloc] initWithFrame:bounds]; hostingView.hostedGraph = graph; graph.paddingTop = CPTFloat(0.0); graph.paddingRight = CPTFloat(0.0); graph.paddingBottom = CPTFloat(0.0); graph.paddingLeft = CPTFloat(0.0); graph.plotAreaFrame.paddingTop = CPTFloat(0.0); graph.plotAreaFrame.paddingRight = CPTFloat(0.0); graph.plotAreaFrame.paddingBottom = CPTFloat(0.0); graph.plotAreaFrame.paddingLeft = CPTFloat(0.0); graph.plotAreaFrame.masksToBorder = NO; CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; CPTXYAxis *x = axisSet.xAxis; x.labelingPolicy = CPTAxisLabelingPolicyNone; x.title = nil; CPTXYAxis *y = axisSet.yAxis; y.labelingPolicy = CPTAxisLabelingPolicyNone; y.title = nil;