Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chartist-html

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chartist-html

html store and no-JavaScript input syntax for Chartist.js charts. Includes JavaScript code that brings static html snippets back to life once they are rendered.

  • 0.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

chartist-html

Proposal for a JS-less input syntax for Chartist.js charts, written in pure HTML. ChartistHtml brings static html snippets back to life on command, including tooltips, custom high-level options and number formatting using numeral.

Installation

Simply install using bower:

bower install --save chartist-html

Usage

Create your first chart and include it your html:

<div class="cts" data-type="bar" data-options="stacked|horizontal">
	<ul>
		<li class="cts__labels">May|June|July|August|September</li>
		<li class="cts__series" data-name="Federal">1|2|3|4|5</li>
		<li class="cts__series" data-name="State">1|2|3|4|5</li>
		<li class="cts__series" data-name="Local">1|2|3|4|5</li>
	</ul>
</div>

Add the script once document is loaded:

ChartistHtml.render();

The unordered list tag is now hidden (in case you didn't readily style it so), and has the fully rendered Chartist.js chart as its sibling:

<div class="cts" data-type="bar" data-options="stacked|horizontal">
	<ul>...</ul>
	<div class="ct-chart">
		<svg><!-- --></svg>
	</div>
</div>

Why?

This library gives you the option to store all chart data in your html without having to add any JavaScript dependencies. This will come in handy if:

  • you want to keep things very simple when you are managing several charts on a single webpage.
  • you store static html snippets in a database (such as your next technical blog post).

Features:

  • html snippets store data and core layout storage only.
  • global option settings keep Chartist styling DRY.
  • friendly for those who would rather not write JavaScript.
  • the most intuitive syntax in the world? Sounds far-fetched? Feel like giving me a hand?

FAQs

Package last updated on 16 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc