dojox.gfx still does not have a logarithmic axis.
Update. One way to do this is to reassign the data along the logarithmic axis and use a linear axis with custom labels. For instance:
var LOG10 = Math.log(10);
var data = [...];
var transformedData = dojo.map(data, function(value){
return {
x: Math.log(value.x) / LOG10,
y: value.y
};
});
chart.addAxis("x", {
natural: true,
includeZero: true,
labels: [
{value: 0, text: "1"},
{value: 1, text: "10"},
{value: 2, text: "100"},
{value: 3, text: "1000"},
{value: 4, text: "10^4"},
{value: 5, text: "10^5"},
{value: 6, text: "10^6"},
{value: 7, text: "10^7"},
{value: 8, text: "10^8"},
{value: 9, text: "10^9"}
]
});
chart.addSeries("my data", transformedData);
Something like this will do the trick. Another option is to use the marking function to automatically generate “logarithmic” labels.
source
share