master-patched
Tyler Wolf 11 years ago
commit aad23db0f0

@ -11,11 +11,18 @@ text {
font: 12px sans-serif;
}
.mypiechart {
width: 500px;
border: 2px;
}
</style>
<body>
<svg id="test1"></svg>
<svg id="test2"></svg>
<h2>Test1</h2>
<svg id="test1" class="mypiechart"></svg>
<h2>Test2</h2>
<svg id="test2" class="mypiechart"></svg>
<script src="../lib/d3.v2.js"></script>
<script src="../nv.d3.js"></script>
@ -23,26 +30,26 @@ text {
<script src="../src/models/pie.js"></script>
<script src="../src/models/pieChart.js"></script>
<script src="../src/utils.js"></script>
<script>
<script>
var testdata = [
{
{
key: "One",
y: 5
},
{
{
key: "Two",
y: 2
},
{
{
key: "Three",
y: 9
},
{
{
key: "Four",
y: 7
},
{
{
key: "Five",
y: 4
},
@ -57,14 +64,11 @@ text {
];
var chart;
nv.addGraph(function() {
var width = 500,
height = 500;
chart = nv.models.pieChart()
var chart = nv.models.pieChart()
.x(function(d) { return d.key })
.y(function(d) { return d.y })
//.showLabels(false)
@ -86,6 +90,7 @@ nv.addGraph(function() {
});
nv.addGraph(function() {
var width = 500,
height = 500;
@ -98,14 +103,14 @@ nv.addGraph(function() {
.color(d3.scale.category10().range())
.width(width)
.height(height)
.donut(false);
chart.pie.donutLabelsOutside(true).donut(true);
.donut(true);
chart.pie
.startAngle(function(d) { return d.startAngle/2 -Math.PI/2 })
.endAngle(function(d) { return d.endAngle/2 -Math.PI/2 });
//chart.pie.donutLabelsOutside(true).donut(true);
d3.select("#test2")
//.datum(historicalBarChart)
.datum([testdata])

@ -233,10 +233,10 @@ nv.models.multiBarChart = function() {
if(rotateLabels)
xTicks
.selectAll('text')
.attr('transform', function(d,i,j) { return 'rotate('+rotateLabels+' 0,0)' })
.attr('text-transform', rotateLabels > 0 ? 'start' : 'end');
.selectAll('text')
.attr('transform', 'rotate(' + rotateLabels + ' 0,0)')
.attr('text-anchor', rotateLabels > 0 ? 'start' : 'end');
g.select('.nv-x.nv-axis').selectAll('g.nv-axisMaxMin text')
.style('opacity', 1);

Loading…
Cancel
Save