Skip to content

Instantly share code, notes, and snippets.

@wordyallen
Created April 7, 2016 17:01
Show Gist options
  • Save wordyallen/c85c586a9f88acce8ad65b1696fbec4d to your computer and use it in GitHub Desktop.
Save wordyallen/c85c586a9f88acce8ad65b1696fbec4d to your computer and use it in GitHub Desktop.
var Datum = React.createClass({
render: function() {
// chart properties
var dataSets = [
{
values: this.props.dataset1,
key: "Transmitted Signal",
color: '#1FB0C5'
},
{
values: this.props.dataset2,
key: 'Received Signal',
color: '#2ca02c'
}
];
var xAxis=
{
axisLabel: 'Sample/Bit Index',
tickFormat: d3.format(',r')
}
var yAxis=
{
axisLabel: 'Relative Voltage',
tickFormat: d3.format('.02f')
}
return (
<div className="datum">
<h4>
At a noise level of {this.props.noise},
the following message was received:
&nbsp;{this.props.children}
</h4>
<NVD3Chart
type="lineChart"
useInteractiveGuideline={true}
datum={dataSets}
xAxis={xAxis} yAxis={yAxis}
/>
</div>
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment