HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<!DOCTYPE html>
<html>
<head>
<title>Flexmonster-React</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.24/browser.min.js"></script>
<script src="https://cdn.fusioncharts.com/code/latest/react-fusioncharts.js"></script>
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<script src="https://cdn.flexmonster.com/lib/flexmonster.fusioncharts.js"></script>
<!-- Flexmonster Theme -->
<link rel="stylesheet" type="text/css" href="https://cdn.flexmonster.com/theme/teal/flexmonster.min.css" />
<script src="https://static.fusioncharts.com/code/latest/fusioncharts.js"></script>
<script type="text/javascript" src="https://unpkg.com/react-fusioncharts@2.0.1/dist/react-fusioncharts.min.js"></script>
<!-- FusionCharts Themes -->
<script src="https://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.fusion.js"></script>
<script src="https://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.candy.js"></script>
<script src="https://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.gammel.js"></script>
</head>
<body>
<div id="fm-component"></div>
<table>
<tr>
<td><div id="doughnutchart-container"></div></td>
<td><div id="columnchart-container"></div></td>
<td><div id="barchart-container"></div></td>
</tr>
<tr>
<td><div id="areachart-container"></div></td>
<td><div id="linechart-container"></div></td>
<td><div id="linechart-container2"></div></td>
</tr>
</table>
<div id="radarchart-container"></div>
</body>
</html>
ReactDOM.render( <
FlexmonsterReact.Pivot toolbar = {
true
}
width = {
"100%"
}
componentFolder = "https://cdn.flexmonster.com/"
licenseFilePath = "https://cdn.flexmonster.com/codepen.key"
report = {
{
"dataSource": {
"dataSourceType": "json",
"data": getData()
},
"slice": {
"reportFilters": [
{
"uniqueName": "Customer Satisfaction"
}
],
"rows": [
{
"uniqueName": "Date.Year"
}
],
"columns": [
{
"uniqueName": "[Measures]"
},
{
"uniqueName": "Average Time to Solve An Issue"
}
],
"measures": [
{
"uniqueName": "Revenue",
"aggregation": "sum"
},
{
"uniqueName": "Client Support Cost",
"aggregation": "sum"
}
]
},
"options": {
"grid": {
"type": "classic"
}
},
"formats": [{
"name": "",
"maxDecimalPlaces": 2
}]
}
}
reportcomplete = {
createCharts
}
/>,
document.getElementById("fm-component"), console.log("React component was successfully rendered")
);
function createCharts() {
createDoughnutChart();
createColumnChart();
createBarChart();
//createRadarChart();
createAreaChart();
createLineChart();
createLineChart2();
}
function createDoughnutChart() {
flexmonster.fusioncharts.getData({
type: "doughnut2d",
"slice": {
"rows": [{
"uniqueName": "Customer Satisfaction"
}],
"columns": [{
"uniqueName": "[Measures]"
}],
"measures": [{
"uniqueName": "Requests",
"aggregation": "sum"
}]
}
}, drawChart, updateChart);
}
function drawChart(data) {
var chartConfigs = {
type: 'doughnut2d', // The chart type
width: '500', // Width of the chart
height: '350', // Height of the chart
dataFormat: 'json'
};
data.chart.palettecolors = "5d62b5,29c3be,f2726f,187572";
data.chart.theme = "gammel";
data.chart.centerLabel = "$value";
data.chart.showLegend = "1";
data.chart.caption = "Customer Satisfaction";
chartConfigs.dataSource = data;
ReactDOM.render( <
ReactFC {
...chartConfigs
}
/>,
document.getElementById('doughnutchart-container')
);
}
function updateChart(data) {
var chartConfigs = {
type: 'doughnut2d', // The chart type
width: '500', // Width of the chart
height: '350', // Height of the chart
dataFormat: 'json'
};
data.chart.palettecolors = "5d62b5,29c3be,f2726f,187572";
data.chart.theme = "gammel";
data.chart.centerLabel = "$value";
data.chart.showLegend = "1";
data.chart.caption = "Customer Satisfaction";
chartConfigs.dataSource = data;
ReactDOM.render( <
ReactFC {
...chartConfigs
}
/>,
document.getElementById('doughnutchart-container')
);
}
function createColumnChart() {
var chartConfigs = {
type: 'mscolumn2d', // The chart type
width: '500', // Width of the chart
height: '350', // Height of the chart
dataFormat: 'json'
};
flexmonster.fusioncharts.getData({
type: "mscolumn2d",
"slice": {
"rows": [{
"uniqueName": "Date.Month"
}],
"columns": [{
"uniqueName": "[Measures]"
}],
"measures": [{
"uniqueName": "Revenue",
"aggregation": "sum"
}
]
}
}, function(data) {
data.chart.xAxisName = undefined;
data.chart.yAxisName = undefined;
data.chart.palettecolors = "009688,f2726f";
data.chart.theme = "gammel"; // apply the FusionCharts theme
data.chart.caption = "Revenue";
data.chart.subcaption = "by months";
data.chart.showToolTip = "0";
data.chart.numberPrefix = "$";
data.chart.showLegend = "1";
chartConfigs.dataSource = data;
ReactDOM.render( <
ReactFC {
...chartConfigs
}
/>,
document.getElementById('columnchart-container')
);
}, function(data) {
//FF5733
data.chart.xAxisName = undefined;
data.chart.yAxisName = undefined;
data.chart.palettecolors = "009688,f2726f";
data.chart.theme = "gammel"; // apply the FusionCharts theme
data.chart.caption = "Revenue";
data.chart.subcaption = "by months";
data.chart.showToolTip = "0";
data.chart.numberPrefix = "$";
data.chart.showLegend = "1";
chartConfigs.dataSource = data;
ReactDOM.render( <
ReactFC {
...chartConfigs
}
/>,
document.getElementById('columnchart-container')
);
});
}
function createBarChart() {
var chartConfigs = {
type: 'bar2d', // The chart type
width: '500', // Width of the chart
height: '350', // Height of the chart
dataFormat: 'json'
};
flexmonster.fusioncharts.getData({
type: "bar2d",
"slice": {
"rows": [{
"uniqueName": "Average Time to Solve An Issue"
}],
"columns": [{
"uniqueName": "[Measures]"
}],
"measures": [{
"uniqueName": "Revenue",
"aggregation": "count"
}]
}
}, function(data) {
data.chart.xAxisName = undefined;
data.chart.yAxisName = undefined;
data.chart.palettecolors = "187572,29c3be,f2726f,187572";
data.chart.theme = "gammel"; // apply the FusionCharts theme
data.chart.caption = "Average Time to Solve An Issue";
data.chart.showLegend = "1";
chartConfigs.dataSource = data;
ReactDOM.render( <
ReactFC {
...chartConfigs
}
/>,
document.getElementById('barchart-container')
);
}, function(data) {
data.chart.xAxisName = undefined;
data.chart.yAxisName = undefined;
data.chart.palettecolors = "187572,29c3be,f2726f,187572";
data.chart.theme = "gammel"; // apply the FusionCharts theme
data.chart.caption = "Average Time to Solve An Issue";
data.chart.showLegend = "1";
chartConfigs.dataSource = data;
ReactDOM.render( <
ReactFC {
...chartConfigs
}
/>,
document.getElementById('barchart-container')
);
});
}
function createAreaChart() {
flexmonster.fusioncharts.getData({
type: "area2d",
"slice": {
"rows": [{
"uniqueName": "Date.Year"
}],
"columns": [{
"uniqueName": "[Measures]"
}],
"measures": [{
"uniqueName": "Client Support Cost",
"aggregation": "sum"
}]
}
}, function(data) {
data.chart.xAxisName = undefined;
data.chart.yAxisName = undefined;
data.chart.palettecolors = "187572";
data.chart.theme = "gammel"; // apply the FusionCharts theme
data.chart.caption = "Costs per Client Support";
data.chart.numberPrefix = "$";
data.chart.showLegend = "1";
var chartConfigs = {
type: 'area2d', // The chart type
width: '500', // Width of the chart
height: '350', // Height of the chart
dataFormat: 'json', // Data type
dataSource: data
};
ReactDOM.render( <
ReactFC {
...chartConfigs
}
/>,
document.getElementById('areachart-container')
);
}, function(data) {
data.chart.xAxisName = undefined;
data.chart.yAxisName = undefined;
data.chart.palettecolors = "187572";
data.chart.theme = "gammel"; // apply the FusionCharts theme
data.chart.caption = "Costs per Client Support";
data.chart.numberPrefix = "$";
data.chart.showLegend = "1";
var chartConfigs = {
type: 'area2d', // The chart type
width: '500', // Width of the chart
height: '350', // Height of the chart
dataFormat: 'json', // Data type
dataSource: data
};
ReactDOM.render( <
ReactFC {
...chartConfigs
}
/>,
document.getElementById('areachart-container')
);
});
}
function createLineChart() {
flexmonster.fusioncharts.getData({
type: "line",
"slice": {
"rows": [{
"uniqueName": "Date.Month"
}],
"columns": [{
"uniqueName": "[Measures]"
}],
"measures": [{
"uniqueName": "Requests",
"aggregation": "sum"
}]
}
}, function(data) {
data.chart.xAxisName = undefined;
data.chart.yAxisName = undefined;
data.chart.palettecolors = "29c3be,f2726f,187572";
data.chart.theme = "gammel"; // apply the FusionCharts theme
data.chart.caption = "Requests over months";
data.chart.showLegend = "1";
var chartConfigs = {
type: 'line', // The chart type
width: '500', // Width of the chart
height: '350', // Height of the chart
dataFormat: 'json', // Data type
dataSource: data
};
ReactDOM.render( <
ReactFC {
...chartConfigs
}
/>,
document.getElementById('linechart-container')
);
}, function(data) {
data.chart.xAxisName = undefined;
data.chart.yAxisName = undefined;
data.chart.palettecolors = "29c3be,f2726f,187572";
data.chart.theme = "gammel"; // apply the FusionCharts theme
data.chart.caption = "Requests over months";
data.chart.showLegend = "1";
var chartConfigs = {
type: 'line', // The chart type
width: '500', // Width of the chart
height: '350', // Height of the chart
dataFormat: 'json', // Data type
dataSource: data
};
ReactDOM.render( <
ReactFC {
...chartConfigs
}
/>,
document.getElementById('linechart-container')
);
});
}
function createLineChart2() {
flexmonster.fusioncharts.getData({
type: "line",
"slice": {
"rows": [{
"uniqueName": "Date.Month"
}],
"columns": [{
"uniqueName": "[Measures]"
}],
"measures": [{
"uniqueName": "Answered Calls",
"aggregation": "sum"
}]
}
}, function(data) {
data.chart.xAxisName = undefined;
data.chart.yAxisName = undefined;
data.chart.palettecolors = "29c3be,f2726f,187572";
data.chart.theme = "gammel"; // apply the FusionCharts theme
data.chart.caption = "Answered calls over months";
data.chart.showLegend = "1";
var chartConfigs = {
type: 'line', // The chart type
width: '500', // Width of the chart
height: '350', // Height of the chart
dataFormat: 'json', // Data type
dataSource: data
};
ReactDOM.render( <
ReactFC {
...chartConfigs
}
/>,
document.getElementById('linechart-container2')
);
}, function(data) {
data.chart.xAxisName = undefined;
data.chart.yAxisName = undefined;
data.chart.palettecolors = "29c3be,f2726f,187572";
data.chart.theme = "gammel"; // apply the FusionCharts theme
data.chart.caption = "Answered calls over months";
data.chart.showLegend = "1";
var chartConfigs = {
type: 'line', // The chart type
width: '500', // Width of the chart
height: '350', // Height of the chart
dataFormat: 'json', // Data type
dataSource: data
};
ReactDOM.render( <
ReactFC {
...chartConfigs
}
/>,
document.getElementById('linechart-container2')
);
});
}
function getData() {
return [{
"Customer Satisfaction": {
"type": "string"
},
"Average Time to Solve An Issue": {
"type": "string"
},
"Revenue": {
"type": "number"
},
"Client Support Cost": {
"type": "number"
},
"Requests": {
"type": "number"
},
"Date": {
"type": "date"
},
"Date Time": {
"type": "date string"
},
"Answered Calls": {
"type": "number"
}
},
{
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 455,
"Client Support Cost": 250,
"Requests": 55,
"Date": "2018-02-14T07:34:08",
"Date Time": "2018-02-14T07:34:08",
"Answered Calls": 45
},
{
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 455,
"Client Support Cost": 250,
"Requests": 55,
"Date": "2018-04-14T07:34:08",
"Date Time": "2018-04-14T07:34:08",
"Answered Calls": 45
},
{
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 156,
"Client Support Cost": 501,
"Requests": 55,
"Date": "2018-02-14T07:34:08",
"Date Time": "2018-02-14T07:34:08",
"Answered Calls": 48
},
{
"Customer Satisfaction": "Very satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 455,
"Client Support Cost": 302,
"Requests": 75,
"Date": "2018-01-11T07:28:30",
"Date Time": "2019-01-11T07:28:30",
"Answered Calls": 95
},
{
"Customer Satisfaction": "Very satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 455,
"Client Support Cost": 205,
"Requests": 75,
"Date": "2019-01-11T07:28:30",
"Date Time": "2016-01-11T07:28:30",
"Answered Calls": 14
},
{
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 236,
"Client Support Cost": 63,
"Requests": 55,
"Date": "2019-11-27T06:52:07",
"Answered Calls": 45
},
{
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 355,
"Client Support Cost": 140,
"Requests": 55,
"Date": "2019-11-27T06:52:07",
"Answered Calls": 43
},
{
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 354,
"Client Support Cost": 88,
"Requests": 65,
"Date": "2019-10-13T05:34:44",
"Answered Calls": 45
}, {
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "1 - 2 hours",
"Revenue": 354,
"Client Support Cost": 170,
"Requests": 65,
"Date": "2019-10-13T05:34:44",
"Answered Calls": 45
},
{
"Customer Satisfaction": "Neutral",
"Average Time to Solve An Issue": "1 - 2 hours",
"Revenue": 354,
"Client Support Cost": 230,
"Requests": 55,
"Date": "2014-11-20T07:16:26",
"Answered Calls": 45
},
{
"Customer Satisfaction": "Neutral",
"Average Time to Solve An Issue": "1 - 2 hours",
"Revenue": 354,
"Client Support Cost": 160,
"Requests": 25,
"First Name": "Vega",
"Last Name": "Sexton",
"Company": "KONNECT",
"Date": "2018-12-18T01:26:57",
"Answered Calls": 22
},
{
"Customer Satisfaction": "Neutral",
"Average Time to Solve An Issue": "1 - 2 hours",
"Revenue": 352,
"Client Support Cost": 180,
"Date": "2018-09-12T05:29:36",
"Answered Calls": 89
},
{
"Customer Satisfaction": "Neutral",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 654,
"Client Support Cost": 190,
"Requests": 23,
"Date": "2019-06-13T11:43:37",
"Answered Calls": 78
},
{
"ID": 8,
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 355,
"Client Support Cost": 140,
"Requests": 55,
"Date": "2018-10-03T05:41:44",
"Answered Calls": 23
},
{
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 770,
"Client Support Cost": 177,
"Requests": 23,
"Date": "2014-04-28T06:05:53",
"Answered Calls": 15
},
{
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 770,
"Client Support Cost": 200,
"Requests": 45,
"Date": "2014-06-13T03:03:22",
"Answered Calls": 44
},
{
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 770,
"Client Support Cost": 300,
"Requests": 55,
"Date": "2018-07-28T12:04:26",
"Answered Calls": 22
},
{
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 770,
"Client Support Cost": 140,
"Requests": 55,
"Date": "2014-12-31T10:21:58",
"Answered Calls": 45
},
{
"ID": 13,
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 550,
"Client Support Cost": 120,
"Requests": 55,
"Date": "2017-09-09T07:11:20",
"Answered Calls": 88
},
{
"Customer Satisfaction": "Neutral",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 655,
"Client Support Cost": 88,
"Requests": 45,
"Date": "2014-06-15T12:41:23",
"Answered Calls": 35
},
{
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 354,
"Client Support Cost": 90,
"Requests": 55,
"Date": "2017-12-08T11:25:50",
"Answered Calls": 74
},
{
"Customer Satisfaction": "Neutral",
"Average Time to Solve An Issue": "More than 2 hours",
"Revenue": 322,
"Client Support Cost": 30,
"Requests": 55,
"Date": "2018-03-18T04:39:25",
"Answered Calls": 41
},
{
"Customer Satisfaction": "Unsatisfied",
"Average Time to Solve An Issue": "More than 2 hours",
"Revenue": 322,
"Client Support Cost": 140,
"Requests": 55,
"Date": "2014-11-18T11:59:17",
"Answered Calls": 44
},
{
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 774,
"Client Support Cost": 220,
"Requests": 123,
"Date": "2018-08-06T03:38:09",
"Answered Calls": 99
},
{
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 436,
"Client Support Cost": 130,
"Requests": 123,
"Date": "2014-07-16T08:27:06",
"Answered Calls": 36
},
{
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 655,
"Client Support Cost": 70,
"Requests": 123,
"Date": "2019-02-01T01:16:28",
"Answered Calls": 98
},
{
"Customer Satisfaction": "Satisfied",
"Average Time to Solve An Issue": "Less than 1 hour",
"Revenue": 455,
"Client Support Cost": 140,
"Requests": 123,
"Date": "2019-02-01T01:16:28",
"Answered Calls": 105
}
]
}
Also see: Tab Triggers