Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@amcharts/amcharts3-react
Advanced tools
Readme
Create a package.json
which includes react
, react-dom
, and @amcharts/amcharts3-react
:
{
"devDependencies": {
"react": "^16.0.0",
"react-dom": "^16.0.0",
"@amcharts/amcharts3-react": "^3.0.0"
}
}
Run npm install
Use <script>
tags in your HTML file to load AmCharts:
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
If you are using a bundler (like Webpack), import the @amcharts/amcharts3-react
plugin:
import AmCharts from "@amcharts/amcharts3-react";
If you are using <script>
tags, include the React and amcharts3-react.js
files in your HTML:
<script src="node_modules/react/umd/react.production.min.js"></script>
<script src="node_modules/react-dom/umd/react-dom.production.min.js"></script>
<script src="node_modules/create-react-class/create-react-class.min.js"></script>
<script src="node_modules/@amcharts/amcharts3-react/amcharts3-react.js"></script>
React.createElement(AmCharts.React, {
className: "my-class",
style: {
width: "100%",
height: "500px"
},
options: {
"type": "serial",
"theme": "light",
"graphs": [...],
"dataProvider": [...]
}
})
Or alternatively if you are using JSX:
<AmCharts.React
className="my-class"
style={{
width: "100%",
height: "500px"
}}
options={{
"type": "serial",
"theme": "light",
"graphs": [...],
"dataProvider": [...]
}} />
You can also define the options object separately:
var config = {
"type": "serial",
"theme": "light",
"graphs": [...],
"dataProvider": [...]
};
<AmCharts.React options={config} />
The options
property supports exactly the same configuration as the AmCharts.makeChart
method, so all of the AmCharts demos work the same.
Changes to options
are automatically detected when rendering (you do not need to call validateNow
or validateData
).
In addition, this plugin automatically generates an id
, so you do not need to specify it.
You can find some examples in the examples
folder.
If you want to use plugins (like dataloader, export, responsive, animate, etc.) you will need to include the appropriate <script>
tags.
Here is an example for the export plugin:
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
You can see an example program in the examples/webpack-export
folder. It updates the chart's dataProvider
every 3 seconds.
className
property for specifying the CSS class for the element.react
and react-dom
Rather than passing in the configuration directly, instead you must pass in the configuration using the new options
property.
Adding in delay
property for controlling the chart delay.
Fixing a deprecation warning with React (thanks to Izumi-kun)
Working around a bug with groupToPeriods
React.createClass
(thanks to Izumi-kun)Major breaking change: this plugin no longer automatically imports AmCharts, so you must use <script>
tags to load AmCharts
Major breaking change: you must now use AmCharts.React
rather than AmCharts
dataProvider
AmCharts
with Webpack, instead use AmCharts.React
AmCharts
properties for Webpacklisteners
to trigger multiple timespeerDependencies
FAQs
How to install ==============
The npm package @amcharts/amcharts3-react receives a total of 3,838 weekly downloads. As such, @amcharts/amcharts3-react popularity was classified as popular.
We found that @amcharts/amcharts3-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.