agrobbin / highcharts-js-rails Goto Github PK
View Code? Open in Web Editor NEWEasily configure a Highcharts JS chart for use in a Rails application
License: MIT License
Easily configure a Highcharts JS chart for use in a Rails application
License: MIT License
How would one enable a theme for highcharts? If we include it in the asset pipeline then it gets loaded in before Highcharts.js and thus will not work.
Can you please update it to the latest version (which is 3.0.9)?
highcharts-rails gem has a Highcharts module, whereas in this gem it is a class. Is it possible to make them play nicely? Perhaps by creating a class Highcharts::Chart as I did in my library which I started, which does likewise with this one.
I was struggling a lot to try and display plotLines on graphs and having a ton of trouble. I eventually figured it out, but I think it could be a systemic problem with Array based options. A documentation of my problem and solution can be found at http://stackoverflow.com/questions/13281657/using-highcharts-with-rails-not-displaying-plotlines
I tried the following...
chart.plotOptions(series: {stacking: 'percent'})
which of course doesn't work, since I note that there is no built-in way to handle stacking, so I tried the following:
class Highcharts
class PlotOptions
class PlotType < Base
def initialize(opts = {})
@suboptions = {
:dataLabels => 'Labels',
:dial => 'Base',
:events => 'PlotOptions::PlotType::Events',
:marker => 'PlotOptions::PlotType::Marker',
:pivot => 'Base',
:point => 'Point',
:states => 'PlotOptions::PlotType::States',
:stacking => 'Base'
}
super
end
end
end
end
Of course Base wants a Hash.
I also tried creating a custom class and setting the class constant string above to 'Stacking':
class Highcharts
class Stacking < Base
def initialize(opts = {})
@default = :percent
super
end
end
end
This sort-of works, but it renders as a 'normal' stacking and isn't settable.
If I want to do a quick hack by dropping in a new class definition or definitions, can you suggest how to go about it?
Otherwise, adding stacking to this library would be good.
I'm making a chart which has coloured bands on the yAxis like this: http://www.highcharts.com/demo/spline-plot-bands
http://api.highcharts.com/highcharts#yAxis.plotBands
But the plotBands on the yAxis only accepts a hash, meaning I can't put multiple bands on the same chart.
I would like to use dark-unica but it cannot find it, I assume because the included highcharts is out of date (dark unica is from 7 months ago)?
Also I would suggest somewhere in the readme specifying that you need to add
//= require highcharts
in the application.js
Given the following, the second will overwrite the first...
chart.series(name: 'foo', ...)
chart.series(name: 'bar', ...)
Highcharts allows for the provision of multiple series, but this Ruby interface doesn't. I'm guessing you didn't need that?
While I am working on a fix which adds an array to Highcharts::Series, and requires a change to the Highcharts class to handle series differently, if you get to it first however...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.