Skip to content

Commit ae88c08

Browse files
committed
Update documentation
1 parent 271ca9b commit ae88c08

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### [Demos and Documentation](http://fusioncharts.github.io/react-fusioncharts-component/)
1+
### [Demos and Documentation](http://fusioncharts.github.io/react-fusioncharts/)
22

33
## Introduction
44

@@ -26,9 +26,9 @@ npm install react react-dom fusioncharts react-fusioncharts --save
2626
In your HTML, find the section where you wish to render the chart place a `<div>` for the FusionCharts to be rendered.
2727
`<div id='chart-container'></div>`
2828

29-
#### Step 3: Require react-fusioncharts package from npm
29+
#### Step 3: Import react-fusioncharts package from npm
3030

31-
Require **react**, **react-dom**, **fusioncharts**, and **react-fusioncharts** modules, in this order, through npm. In your JavaScript code, define an object that consists of all the configurations and their values, required to render FusionCharts.
31+
Import **react**, **react-dom**, **fusioncharts**, and **react-fusioncharts** modules, in this order, through npm. In your JavaScript code, define an object that consists of all the configurations and their values, required to render FusionCharts.
3232

3333
```
3434
import React from 'react';
@@ -47,20 +47,22 @@ var chartConfigs = {
4747
```
4848

4949
#### Step 4: Pass the configurations required for FusionCharts and render the chart
50-
##### FusionCharts plugin for react cab be used in two ways.
51-
1. Use the ReactFC component directly in ReactDOM to render the chart. The configurations are passed as props of the component.
52-
2. Create multiple ReactFC component inside your custom defined component to render individual charts. This way you would be able to hold the state in your custom defined component and will be able to perform various activities using the component’s lifecycle hooks.
50+
##### FusionCharts plugin for **react** can be used in two ways:
51+
1. Use the **ReactFC** component directly in **ReactDOM** to render the chart. The configurations are passed as props of the component.
52+
2. Create multiple **ReactFC** component inside your custom defined component to render individual charts. This way you would be able to hold the state in your custom component and will be able to perform various activities using the component’s lifecycle hooks.
5353

5454
##### Method 1:
55-
Render the chart in the React application for a standalone chart, we can choose to make a component class or directly render the chart with the ReactFC component class. The object containing the chart configuration properties are passed to the FusionCharts component as props, as shown below:
55+
Render the chart in the **React** application for a standalone chart, we can choose to make a component class or directly render the chart with the **ReactFC** component class. The object containing the chart configuration properties are passed to the **FusionCharts** component as props, as shown below:
56+
5657
```
5758
ReactDOM.render(
5859
<ReactFC {...chartConfigs} />,
5960
document.getElementById('chart-container')
6061
);
6162
```
63+
6264
##### Method 2:
63-
Creating a custom MyApp component to render the chart
65+
Create a custom MyApp component to render the chart as shown below:
6466

6567
```
6668
var MyApp = React.createClass({
@@ -78,7 +80,9 @@ ReactDOM.render(
7880
document.getElementById('chart-container')
7981
);
8082
```
81-
While the previous method of creating an object, with the configuration properties and values defined, and passing it is recommended, the configuration properties can be passed separately as well, as shown below:
83+
84+
While it is recommended to create an object, with the configuration properties, and passing the values defined, you can also pass the configuration properties separately as shown below:
85+
8286
```
8387
ReactDOM.render(
8488
<ReactFC
@@ -90,6 +94,7 @@ ReactDOM.render(
9094
document.getElementById('chart-container')
9195
);
9296
```
97+
9398
Your chart should now render when the page is loaded.
9499

95100
### Licensing

example/src/index.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ <h3>Step 2: Add the HTML container element for rendering the chart</h3>
109109
<p>In your HTML, find the section where you wish to render the chart place a <code class="language-markup" >&lt;div></code> for the FusionCharts to be rendered.</p>
110110
<pre class="language-markup" ><code class="language-markup" >&lt;div id='chart-container'>&lt;/div></code></pre>
111111
<br>
112-
<h3>Step 3: Require react-fusioncharts package from npm</h3>
113-
<p>Require <code class="language-javascript" >react</code>, <code class="language-javascript" >react-dom</code>, <code class="language-javascript" >fusioncharts</code>, and <code class="language-javascript" >react-fusioncharts</code> modules, in this order, through npm. In your JavaScript code, define an object that consists of all the configurations and their values, required to render FusionCharts.</p>
112+
<h3>Step 3: Import react-fusioncharts package from npm</h3>
113+
<p>Import <code class="language-javascript" >react</code>, <code class="language-javascript" >react-dom</code>, <code class="language-javascript" >fusioncharts</code>, and <code class="language-javascript" >react-fusioncharts</code> modules, in this order, through npm. In your JavaScript code, define an object that consists of all the configurations and their values, required to render FusionCharts.</p>
114114
<pre class="language-javascript" >
115115
<code class="language-javascript" >import React from 'react';
116116
import ReactDOM from 'react-dom';
@@ -128,20 +128,20 @@ <h3>Step 3: Require react-fusioncharts package from npm</h3>
128128
<br>
129129
<h3>Step 4: Pass the configurations required for FusionCharts and render the chart</h3>
130130

131-
<p>FusionCharts plugin for react can be used in two ways.</p>
132-
<p><b>1. </b>Use the ReactFC component directly in ReactDOM to render the chart. The configurations are passed as props of the component.</p>
133-
<p><b>2. </b>Create multiple ReactFC component inside your custom defined component to render individual charts. This way you would be able to hold the state in your custom defined component and will be able to perform various activities using the component’s lifecycle hooks.</p>
131+
<p>FusionCharts plugin for <code class="language-javascript" >react</code> can be used in two ways.</p>
132+
<p><b>1. </b>Use the <code class="language-javascript" >ReactFC</code> component directly in <code class="language-javascript" >ReactDOM</code> to render the chart. The configurations are passed as props of the component.</p>
133+
<p><b>2. </b>Create multiple <code class="language-javascript" >ReactFC</code> component inside your custom defined component to render individual charts. This way you would be able to hold the state in your custom defined component and will be able to perform various activities using the component’s lifecycle hooks.</p>
134134
<p>&nbsp;</p>
135-
<b>Method 1:</b> Render the chart in the React application
136-
for a standalone chart, we can choose to make a component class or directly render the chart with the ReactFC component class. The object containing the chart configuration properties are passed to the FusionCharts component as props, as shown below
135+
<b>Method 1: </b> Render the chart in the <code class="language-javascript" >React</code> application
136+
for a standalone chart, we can choose to make a component class or directly render the chart with the <code class="language-javascript" >ReactFC</code> component class. The object containing the chart configuration properties are passed to the FusionCharts component as props, as shown below
137137

138138
<pre class="language-markup" ><code class="language-markup" >ReactDOM.render(
139139
&lt;ReactFC {...chartConfigs} />,
140140
document.getElementById('chart-container')
141141
);
142142
</code></pre>
143143

144-
<p><b>Method 2:</b> Creating a custom MyApp component to render the chart</p>
144+
<p><b>Method 2: </b> Create a custom MyApp component to render the chart as shown below:</p>
145145
<pre class="language-markup" ><code class="language-markup" >var MyApp = React.createClass({
146146
..., // Rest of the React Component Code
147147
render: function () {
@@ -158,7 +158,7 @@ <h3>Step 4: Pass the configurations required for FusionCharts and render the cha
158158
);
159159
</code></pre>
160160
<p>&nbsp;</p>
161-
<p>While the previous method of creating an object, with the configuration properties and values defined, and passing it is recommended, the configuration properties can be passed separately as well, as shown below</p>
161+
<p>While it is recommended to create an object, with the configuration properties, and passing the values defined, you can also pass the configuration properties separately as shown below:</p>
162162
<pre class="language-markup" >
163163
<code class="language-markup" >ReactDOM.render(
164164
&lt;ReactFC

0 commit comments

Comments
 (0)