Home Forums Porto Admin Template Atribute € to units of the graph

This topic contains 4 replies, has 2 voices, and was last updated by  claudiopardal 3 months, 1 week ago. This post has been viewed 152 times

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #10026549

    claudiopardal
    Participant

    Hello,
    I want to set the € value to the units of yy on the graphs, is it possible?

    thank you


    #10026550

    claudiopardal
    Participant

    image


    #10026552

    claudiopardal
    Participant
    #10026558

    Support2
    Keymaster

    Hello,

    For it you can use the option tickformatter inside yaxis at (js/examples/examples.dashboard.js):

    if( $('#flotDashSales1').get(0) ) {
    	var flotDashSales1 = $.plot('#flotDashSales1', flotDashSales1Data, {
    		series: {
    			lines: {
    				show: true,
    				lineWidth: 2
    			},
    			points: {
    				show: true
    			},
    			shadowSize: 0
    		},
    		grid: {
    			hoverable: true,
    			clickable: true,
    			borderColor: 'rgba(0,0,0,0.1)',
    			borderWidth: 1,
    			labelMargin: 15,
    			backgroundColor: 'transparent'
    		},
    		yaxis: {
    			min: 0,
    			color: 'rgba(0,0,0,0.1)',
    			tickFormatter: function (val, axis) {
    			    return val + "€";
    			}
    		},
    		xaxis: {
    			mode: 'categories',
    			color: 'rgba(0,0,0,0)'
    		},
    		legend: {
    			show: false
    		},
    		tooltip: true,
    		tooltipOpts: {
    			content: '%x: %y',
    			shifts: {
    				x: -30,
    				y: 25
    			},
    			defaultTheme: false
    		}
    	});
    
    }

    * Note the yaxis with new option tickformatter.

    Please, try that and let us know if you need further assistance.

    Kind Regards,

    Rodrigo.


    #10026571

    claudiopardal
    Participant

    it works! 😉 thank you! 🙂


Viewing 5 posts - 1 through 5 (of 5 total)