Comments (24)
Is there a plan to integrate this in core Chartist in near future?
from chartist.
I published my log axis patch as npm package:
https://github.com/hansmaad/chartist-logaxis
It also supports minor grid lines now:
from chartist.
Hi @alejoar
This is currently not possible and I'm not sure if and when this will get into Chartist. Let's keep this issue open and track the need for this.
Cheers
Gion
from chartist.
Log scales are used in many applications in engineering. I think this is a very important feature to implement asap.
I'm not a js developer (just starting), but I will give a look to sources and I will evaluate if I will be able to help for this issue.
from chartist.
Indeed, @dscmax. I was actually looking into this to use it in my diploma project to present some results. Right now I'm in another stage, but I presume I'll start working with charts in a couple of months, and I really hope I can use chartist by then, but log scales are a must have for me.
from chartist.
@gionkunz if the scale is declared as log in the options object, does the animation need to be mathematically scaled like the graph itself?
from chartist.
Once the new axes classes are stable we can create a log scale axis and make it cconfigurable. This is currently WIP and will be stable on dev soon.
from chartist.
Sounds good.
from chartist.
Sounds awesome, logarithmic scales would be nice.
from chartist.
There is still an open PR that we need to review and unfortunately I didn't find so much time for Chartist lately :( #185
from chartist.
The groundwork for this is there. It's just a matter of time and contribution to implement an axis. The new dynamic axis instantiating in 0.9.0 makes this very easy. http://gionkunz.github.io/chartist-js/getting-started.html#switching-axis-type
Maybe the FixedScaleAxis and AutoScaleAxis could be extended with an option to plot in log scale?
from chartist.
I've implemented a scale option for AutoScaleAxis here hansmaad/chartist-js@4ddd949 . Works well for my test cases. Unfortunately, I didn't find any axes unit test, where I could add some quick tests. If it's ok for you I can create a PR.
from chartist.
I would very much like to have the ability to ability to automatically apply logarithmic scaling. Is this feature still in dev only? Can I contribute? I'm planning to use chartist in my electron-based desktop application, which requires this feature, and I'd much rather work with the maintainers than fork and make my own hack.
Ultimately, I'm trying to get something similar to what is produced by MS Excel 2016's XY scatter plot:
from chartist.
@jacobq I had a PR for this, but we're still not sure how to integrate this into core chartist. I hope we will get this as core feature or plugin in the next major version.
For now, I'm using this code, to patch chartist in my application:
https://github.com/hansmaad/chartist-js/blob/logAxis/src/scripts/axes/auto-scale-axis.js
I'm using this in production for several month, and it runs fine.
@gionkunz I moved the code to another branch and deleted the PR. Should I reopen?
from chartist.
@hansmaad @gionkunz I'm not sure how busy you are / how much time you have to work on chartist, but in case it's helpful, I've attempted to come up with a more general / natural way to integrate scale transformations like this with the rest of the code.
How it basically works is:
- Define transformation functions (e.g.
Chartist.Transformations.logBase(2)
) - By default,
AutoScaleAxis
will useChartist.Transformations.linear
(identity function). The user/caller can override by settingoptions.scalingTransformation
. - In order to keep the nice / uniform spacing,
AutoScaleAxis
applies the transformation tohighLow
before callinggetBounds
then applies the inverse transformation to the results. That way the function being called (getBounds
in this case) doesn't need to be concerned with the transformation.
Note: I haven't tried working this into FixedScaleAxis
or testing in bar charts yet but plan to do so eventually. Hopefully most of this can be pulled up to Axis
cleanly.
If you have time, please take a look and let me know your thoughts. (I know it's a little rough around the edges but perhaps this will give you some ideas or at least generate some discussion.)
https://github.com/jacobq/chartist-js/tree/scale-transformation
from chartist.
@jacobq your script works perfectly, but overrides my ticks.
My situation is a bit different from your. I need to represent logarithmic scale with my ticks ([10, 16, 25...25000]) instead of your (10, 100, 1000).
Any ideas? thank u
Regards,
Alessio
from chartist.
@jacobq I'm trying to use your implementation but had no success. I want to plot a bar chart and the Y axis needs to be represented with a logarithmic scale. I have no 0 values in my series but what i'm getting is the following error.
Uncaught Error: The input to the logarithm function must be a positive real number not equal to 0. (got 0)
from chartist.
@hansmaad is your code to create a log scale still functioning with chartist 0.9.7? I'm having issues understanding how to implement it into my own charts
from chartist.
@lucadegasperi This is the actual code I'm using https://gist.github.com/hansmaad/0dcf0b525b94ee09edb0e0bcbe8a0f4e
from chartist.
@hansmaad thanks!
from chartist.
@hansmaad I've noticed that what I needed was not a full log scale but a semi-log scale, like the ones used in trading apps. Have you had any luck implementing something similar? thanks.
from chartist.
@lucadegasperi According https://en.wikipedia.org/wiki/Semi-log_plot a semi-log plot has only one log axis. You can define one axis with log scale, while the other stays linear. Is this what you mean?
from chartist.
@hansmaad my bad, Im fairly new to the subject. What I meant is having a logarithmic scale on one axis (which indeed I have) but not have it tied to the decades. The underlying grid should also be irregular with items less and less spaced apart. Is there a way I can contact you privately?
from chartist.
Yeah, without both log scale and error bars (#232) out of the box, this is somewhat complicated to use with scientific data..
from chartist.
Related Issues (20)
- [Bug]: More descriptive error message when DOM node for container was not found
- [Bug]: SASS styling no longer available HOT 8
- Please provide a `dist` folder at the root of the repository HOT 1
- [Bug]: Can't import `index.css` HOT 1
- [Bug]: package.json: conflict between `puppeteer` and `@storybook/addon-storyshots-puppeteer` HOT 1
- Do not set Chart.svg as protected or allow direct access in some other way
- Implement SVG graphics export HOT 1
- precompiled releases again like before HOT 3
- [Bug]: Using responsive options fails on some browsers
- [Bug]: old website linked in repo HOT 1
- Please provide a standalone example (HTML/CSS/JS) of Chartist 1.0+ in action HOT 2
- Support for viewBox for scalable and responsive charts
- [Bug]: Pulling from CDN gives latest 0.x.x version HOT 4
- Support dual Y-Axis HOT 1
- barstack with label on bar
- [Bug]: Error: ENOENT: no such file or directory, open '\node_modules\chartist\src\styles\index.scss'
- Support plot legends
- [Bug]: Invalid Homepage Link on npm
- NodeJS JSDOM support - ability to render on the backend
- [Bug]: Prototype Pollution Vulnerability Affecting chartist module, versions >=1.0.0 <=1.3.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chartist.