All Projects → buren → Chartkick Ex

buren / Chartkick Ex

Licence: mit
Create beautiful Javascript charts with minimal code

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Chartkick Ex

Aachartkit
📈📊🚀🚀🚀An elegant modern declarative data visualization chart framework for iOS, iPadOS and macOS. Extremely powerful, supports line, spline, area, areaspline, column, bar, pie, scatter, angular gauges, arearange, areasplinerange, columnrange, bubble, box plot, error bars, funnel, waterfall and polar chart types. 极其精美而又强大的跨平台数据可视化图表框架,支持柱状图、条形图、折…
Stars: ✭ 4,358 (+3722.81%)
Mutual labels:  chart, charting-library
Amcharts4
The most advanced amCharts charting library for JavaScript and TypeScript apps.
Stars: ✭ 907 (+695.61%)
Mutual labels:  chart, charting-library
Chartjs Chart Financial
Chart.js module for charting financial securities
Stars: ✭ 469 (+311.4%)
Mutual labels:  chart, charting-library
Devextreme
HTML5 JavaScript Component Suite for Responsive Web Development
Stars: ✭ 1,385 (+1114.91%)
Mutual labels:  chart, charting-library
React Vis
Data Visualization Components
Stars: ✭ 8,091 (+6997.37%)
Mutual labels:  chart, charting-library
React Chartjs 2
React components for Chart.js, the most popular charting library
Stars: ✭ 4,667 (+3993.86%)
Mutual labels:  chart, charting-library
Chartkick.py
Create beautiful Javascript charts with minimal code
Stars: ✭ 695 (+509.65%)
Mutual labels:  chart, charting-library
Plottable
📊 A library of modular chart components built on D3
Stars: ✭ 2,834 (+2385.96%)
Mutual labels:  chart, charting-library
Swiftchart
Line and area chart library for iOS
Stars: ✭ 950 (+733.33%)
Mutual labels:  chart, charting-library
Teechart Firemonkey Samples
Sample programs showing how to use TeeChart for FireMonkey
Stars: ✭ 21 (-81.58%)
Mutual labels:  chart, charting-library
React Jsx Highcharts
Highcharts built with proper React components
Stars: ✭ 336 (+194.74%)
Mutual labels:  chart, charting-library
Asciichart
Nice-looking lightweight console ASCII line charts ╭┈╯ for NodeJS, browsers and terminal, no dependencies
Stars: ✭ 1,107 (+871.05%)
Mutual labels:  chart, charting-library
Anychart
AnyChart is a lightweight and robust JavaScript charting solution with great API and documentation. The chart types and unique features are numerous, the library works easily with any development stack.
Stars: ✭ 288 (+152.63%)
Mutual labels:  chart, charting-library
Flutter echarts
A Flutter widget to use Apache ECharts (incubating) in a reactive way.
Stars: ✭ 420 (+268.42%)
Mutual labels:  chart, charting-library
Go Chart
go chart is a basic charting library in go.
Stars: ✭ 3,254 (+2754.39%)
Mutual labels:  chart, charting-library
Chart
Quick & smart charting for STDIN
Stars: ✭ 521 (+357.02%)
Mutual labels:  chart, charting-library
HCLineChartView
HCLineChartView is a beautiful iOS library for drawing line charts. It is highly customizable and easy to use.
Stars: ✭ 22 (-80.7%)
Mutual labels:  chart, charting-library
asciichart-sharp
C# port of asciichart
Stars: ✭ 27 (-76.32%)
Mutual labels:  chart, charting-library
Timesheet.js
JavaScript library for HTML5 & CSS3 time sheets
Stars: ✭ 6,881 (+5935.96%)
Mutual labels:  chart, charting-library
Vaadin Charts
Vaadin Charts is a feature-rich interactive graph library that answers the data visualization needs of modern web applications
Stars: ✭ 47 (-58.77%)
Mutual labels:  chart, charting-library

Chartkick Build Status

Create beautiful Javascript charts with one line of Elixir. No more fighting with charting libraries!

See it in action, you can find the example phoenix app that generates that page here.

Works with Phoenix, plain Elixir and most browsers.

Any feedback, suggestions or comments please open an issue or PR.

Charts

All charts expect a JSON string.

raw_data = [[175, 60], [190, 80], [180, 75]]
data = Poison.encode!(raw_data)
# or if you are using Jason
data = Jason.encode!(raw_data)

Line chart

Chartkick.line_chart data

Pie chart

Chartkick.pie_chart data

Column chart

Chartkick.column_chart data

Bar chart

Chartkick.bar_chart data

Area chart

Chartkick.area_chart data

Scatter chart

Chartkick.scatter_chart data

Geo chart

Chartkick.geo_chart Poison.encode!("[[\"United States\",44],[\"Germany\",23]]")
# or if you are using Jason
Chartkick.geo_chart Jason.encode!("[[\"United States\",44],[\"Germany\",23]]")

Timeline

Chartkick.timeline "[
  [\"Washington\", \"1789-04-29\", \"1797-03-03\"],
  [\"Adams\", \"1797-03-03\", \"1801-03-03\"],
  [\"Jefferson\", \"1801-03-03\", \"1809-03-03\"]
]"

Say Goodbye To Timeouts

Make your pages load super fast and stop worrying about timeouts. Give each chart its own endpoint.

Chartkick.line_chart "/path/to/chart.json"

And respond with data as JSON.

Options

ℹ️ This implementation aims to support all options that chartkick.js supports. If there are any missing, please open an issue or a PR.

Id, width and height

Chartkick.line_chart data, id: "users-chart", height: "500px", width: "50%"

Min and max values

Chartkick.line_chart data, min: 1000, max: 5000

min defaults to 0 for charts with non-negative values. Use nil to let the charting library decide.

Colors

Chartkick.line_chart data, colors: ["pink", "#999"]

Stacked columns or bars

Chartkick.column_chart data, stacked: true

Discrete axis

Chartkick.line_chart data, discrete: true

Axis titles

Chartkick.line_chart data, xtitle: "Time", ytitle: "Population"

Straight lines between points instead of a curve

Chartkick.line_chart data, curve: false

Hide points

Chartkick.line_chart data, points: false

Show or hide legend

Chartkick.line_chart data, legend: false

Specify legend position

Chartkick.line_chart data, legend: "bottom"

Defer chart creation until after the page loads

Chartkick.line_chart data, defer: true

Donut chart

Chartkick.pie_chart data, donut: true

Prefix, useful for currency - Chart.js, Highcharts

Chartkick.line_chart data, prefix: "$"

Suffix, useful for percentages - Chart.js, Highcharts

Chartkick.line_chart data, suffix: "%"

Set a thousands separator - Chart.js, Highcharts

Chartkick.line_chart data, decimal: ","

Show a message when data is empty

Chartkick.line_chart data, messages: %{ empty: "My message.."}

Refresh data from a remote source every n seconds

Chartkick.line_chart data, refresh: 60

You can pass options directly to the charting library with:

Chartkick.line_chart data, library: %{ backgroundColor: "#eee" }

See the documentation for Google Charts and Highcharts for more info.

To customize datasets in Chart.js, use:

Chartkick.line_chart data, dataset: %{ borderWidth: 10 }

Data

Pass data as a JSON string.

Chartkick.pie_chart "{\"Football\" => 10, \"Basketball\" => 5}"
Chartkick.pie_chart "[[\"Football\", 10], [\"Basketball\", 5]]"

For multiple series, use the format

Chartkick.line_chart "[
  {name: \"Series A\", data: []},
  {name: \"Series B\", data: []}
]"

Times can be a time, a timestamp, or a string (strings are parsed)

Chartkick.line_chart "{
  1368174456 => 4,
  \"2013-05-07 00:00:00 UTC\" => 7
}"

Installation

You need to set JSON encoder in your config file. This encoder is used to encode options passed to Chartkick.

# config.exs
config :chartkick, json_serializer: Jason

By default when you render a chart it will return both the HTML-element and JS that initializes the chart. This will only work if you load Chartkick in the <head> tag. You can chose to render the JS & HTML separately using the only: :html or only: :script option. Note that if you use those options you need to pass id otherwise it wont work.

line_chart data, id: "my-line-chart", only: :html
line_chart data, id: "my-line-chart", only: :script

For Google Charts, use:

<script src="//www.google.com/jsapi"></script>
<script src="path/to/chartkick.js"></script>

If you prefer Highcharts, use:

<script src="/path/to/highcharts.js"></script>
<script src="path/to/chartkick.js"></script>

Localization

To specify a language for Google Charts, add:

<script>
  var Chartkick = {"language": "de"};
</script>

before the javascript files.

No Elixir? No Problem

Check out

History

View the changelog

Chartkick follows Semantic Versioning

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].