$(function () {
$('#laprueba').highcharts
({
title: { text: 'Resultados segun parametros seleccionados' },
xAxis: { categories: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'] },
tooltip: { shared: true },
plotOptions: { column: { stacking: 'normal' } },
yAxis: [
{
labels: { enabled: false }, title: { text: '' },
allowDecimals: false, min: 0, title: { text: '' },
stackLabels: { enabled: true, formatter: function() { return this.stack; } }
}, {
labels: { enabled: false }, title: { text: '' },
allowDecimals: false, min: 0, title: { text: '' },
stackLabels: { enabled: true, formatter: function() { return this.stack; } }
}, {
labels: { enabled: false }, title: { text: '' },
allowDecimals: false, min: 0, title: { text: '' },
stackLabels: { enabled: true, formatter: function() { return this.stack; } }
},
], plotOptions: { column: { stacking: 'normal' } },
series:
[
{
type: 'column',
name: 'Cursos-2016',
data: [4, 102, 14, 88, 42, 19, 12, 12, 14, 4, 1, 1], stack: '2016',color: Highcharts.getOptions().colors[0]
},
{
type: 'column', name: 'Cursos-2017',
data: [2, 2, 3,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ], stack: '2017',showInLegend: false,color: Highcharts.getOptions().colors[0]
},
{
type: 'column', name: 'Diplomados-2016',
data: [0,0 , 2, 18,0 , 71, 14, 5, 5,0 , 2, 1], stack: '2016',color: Highcharts.getOptions().colors[1]
},
{
type: 'column', name: 'Diplomados-2017',
data: [2, 2, 3, 1,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ], stack: '2017',showInLegend: false,color: Highcharts.getOptions().colors[1]
},
{
name: 'Ventas (Inscripciones) 2016', type: 'spline', yAxis: 1,
data: [14022.9, 11284.99, 847, 37803.35, 18647.95, 22947, 21077, 31609.28, 40776.6, 3411, 14741, 19770],
marker: { enabled: true }, color: Highcharts.getOptions().colors[3],
tooltip: { valuePrefix: '$ ', valueSuffix: ' USD' }
},
{
name: 'Ventas (Inscripciones) 2017', type: 'spline', yAxis: 2,
data: [14250, 700, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
marker: { enabled: true }, color: Highcharts.getOptions().colors[4],
tooltip: { valuePrefix: '$ ', valueSuffix: ' USD' }
}
]
});
});
ASKER
legend: {
layout: 'horizontal',
labelFormatter: function () {
if (this.name.indexOf("-") !=-1)
{
temp = this.name.split("-");
return temp[0];
}
else { return this.name; }
}
},
JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.
TRUSTED BY
ASKER
I tried that, but the problem is that it change me the text of the last two series "Ventas (Inscripciones) 2016" and "Ventas (inscripciones) 2017"
It is possible to apply it just for the first two series????