Evengers
Forum Replies Created
-
P.S.
Here’s the JS that is generated by the Plugin ….
<div id=”ph_Pie_Chart_Test”>
<svg></svg>
</div>jQuery(document).ready(function() {
var nvd3Data_ph_Pie_Chart_Test = [ {
“key”: “user_registered”,
“values”: [ { “label” : “”, “value” : 2014-04-15 11:25:12, “color” : “#2d12c1”}, { “label” : “”, “value” : 2014-04-15 13:12:45, “color” : “#2d12c1”} ],
“color”: “#2d12c1”,
“type”: “1”,
“name”: “Pie_Chart_Test”
} , {
“key”: “user_status”,
“values”: [ { “label” : “”, “value” : 0, “color” : “#190190”}, { “label” : “”, “value” : 0, “color” : “#190190”} ],
“color”: “#190190”,
“type”: “1”,
“name”: “Pie_Chart_Test”
} , {
“key”: “display_name”,
“values”: [ { “label” : “”, “value” : Evengers, “color” : “#c31c21”}, { “label” : “”, “value” : LEI Admin LEI Admin, “color” : “#c31c21”} ],
“color”: “#c31c21”,
“type”: “1”,
“name”: “Pie_Chart_Test”
} ];</p>
<p> nv.addGraph(function() {
var chart = nv.models.discreteBarChart()
.x(function(d) { return d.label })
.y(function(d) { return d.value })
.staggerLabels( true )
.tooltips( true )
.showValues( true )
.valueFormat(d3.format(‘.1f’));</p>
<p> chart.yAxis
.tickFormat(d3.format(‘.1f’));</p>
<p> d3.select(‘#ph_Pie_Chart_Test svg’)
.datum(nvd3Data_ph_Pie_Chart_Test)
.transition().duration(500)
.call(chart);</p>
<p> nv.utils.windowResize(chart.update);</p>
<p> d3.selectAll(‘.nv-bar’).attr(‘class’, ‘ph_Pie_Chart_TestClass’);</p>
<p> return chart;
});
});</p>
<p>I may have a related issue. I can see a simple test bar chart in the admin area. Nothing renders in a post.
I can see with Chrome dev that the div entry for the chart is generated
When I use Chrome dev to inspect javascript I see Syntax Error “Unexpected number” error at line 101. It appears to be that the value for label is not surrounded by quotes.
“values”: [ { “label” : “”, “value” : 2014-04-15 11:25:12, “color” : “#2d12c1”}, { “label” : “”, “value” : 2014-04-15 13:12:45, “color” : “#2d12c1”} ],
“color”: “#2d12c1”,Here’s the entry:
http://lei.risk-management-and-compliance.org/?p=6Thanks in advance for any guidance
Steve