Flotr: Basic Axis Example

Example

This graph show a 5 series. The axis are configured.

Finished? Go to the example index page or the Flotr Documentation Pages.

The Code


var f = Flotr.draw(
	$('container'),[ 
		{data:d1, label:'y = 4 + x^(1.5)', lines:{fill:true}}, 
		{data:d2, label:'y = x^3'}, 
		{data:d3, label:'y = 5 + 3sin(4x)'}, 
		{data:d4, label:'y = x'},
		{data:d5, label:'y = 2x', lines: {show: true}, points: {show: true}}
	],{
		xaxis:{
			noTicks: 7,	// Display 7 ticks.
			tickFormatter: function(n){ return '('+n+')'; }, // => displays tick values between brackets.
			min: 1,		// => part of the series is not displayed.
			max: 7.5	// => part of the series is not displayed.
		},
		yaxis:{
			ticks: [[ 0, "Lower"], 10, 20, 30, [40, "Upper"]],
			max: 40
		}
	}
);