troubleshooting Question

how to customize the text in the legend in highcharts

Avatar of altariamx2003
altariamx2003Flag for Mexico asked on
JavaScriptScripting LanguagesHTML
3 Comments1 Solution3832 ViewsLast Modified:
hi

i got this chart
thechart
$(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' }
               }
            ]
  });
});

Open in new window


I wanna know if it is possible to customize the legend section without to move any of my tooltip, I mean change the legend section from this:legend1 to thislegend2
ASKER CERTIFIED SOLUTION
Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 3 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 3 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004