Commit 5a61421b8718ce744ac0a53e5a57fce8c1ab7134
1 parent
37e81bff
Exists in
master
and in
111 other branches
Support logarithmic axis in coordinates preview
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
js/app/views/PlotComponents/PlotContextManager.js
... | ... | @@ -82,6 +82,12 @@ Ext.define('amdaPlotComp.PlotContextManager', { |
82 | 82 | if (pixelMax == pixelMin) |
83 | 83 | return NaN; |
84 | 84 | |
85 | + if (axisContext.logarithmic) | |
86 | + { | |
87 | + var value = axisContext.min + (pixelValue - pixelMin)/(pixelMax - pixelMin)*(axisContext.max-axisContext.min); | |
88 | + return Math.pow(10,value); | |
89 | + } | |
90 | + | |
85 | 91 | return axisContext.min + (pixelValue - pixelMin)/(pixelMax - pixelMin)*(axisContext.max-axisContext.min); |
86 | 92 | } |
87 | 93 | }); |
88 | 94 | \ No newline at end of file | ... | ... |