Skip to main content

Posts

Showing posts from January, 2014

HightChart disable show/hide function on legend click

In HighChart legend, by default, if you click on the legend item, the related chart will show/hide the part this legend represents. In order to disable this function: For pie chart:     plotOptions: {         column: {             events: {                 legendItemClick: function () {                     return false; // <== returning false will cancel the default action                 }             }         }     } For bar chart:     plotOptions: {         series: {             point: {                 events: {                     legendItemClick: function () {                         return false; // <== returning false will cancel the default action                     }                 }             }         }     }

Set HTML page print size, layout and margin

In your HTML page, you can set up the printer specific style sheet by specifying media="print" media="print" > In order to specify the print page size to Letter size and set the proper margins, use the CSS @page rule: @page {     width: 8.5in; height: 11in;                  /* Letter page size is 8.5 inch X 11 inch */     margin: 0.75in 0.18in 0.75in 0.18in;  /* this affects the margin in the printer settings */ } If you want to set your print layout to landscape, use following @page rule @page {     -webkit-transform: rotate(-90deg); -moz-transform:rotate(-90deg);     filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);     size: landscape;     width: 8.5in; height: 11in;                  /* Letter page size is 8.5 inch X 11 inch */     margin: 0.75in 0.18in 0.75in 0.18in;  /* this affects the margin in the printer settings */ }