Javascript 谷歌图表-更改“更多”链接的颜色
我已经制作了两张饼图和条形图,由于空间限制,它们需要重新调整大小,结果增加了1/2▼ 对于图例部分 我在这里添加了代码: 如果我的问题没有正确显示,这里是我网站的截图,在我想要更改的内容周围画一个圆圈。 如果超过8列,它也会显示在条形图中,如上面的示例所示 那么我的问题是,有没有办法改变文本/链接的颜色?我似乎在网上或api文档中找不到任何东西 任何帮助都将不胜感激Javascript 谷歌图表-更改“更多”链接的颜色,javascript,html,google-visualization,Javascript,Html,Google Visualization,我已经制作了两张饼图和条形图,由于空间限制,它们需要重新调整大小,结果增加了1/2▼ 对于图例部分 我在这里添加了代码: 如果我的问题没有正确显示,这里是我网站的截图,在我想要更改的内容周围画一个圆圈。 如果超过8列,它也会显示在条形图中,如上面的示例所示 那么我的问题是,有没有办法改变文本/链接的颜色?我似乎在网上或api文档中找不到任何东西 任何帮助都将不胜感激 <script type="text/javascript"> // Load the Visu
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
// Create the data table.
var data = new google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Set 1', 215],
['Set 2', 83],
['Set 3', 132],
['Set 4', 72],
['Set 5', 260],
['Set 6', 34],
['Set 7', 9],
['Set 8', 24]
]);
// Create the data table.
var data2 = new google.visualization.arrayToDataTable([
['Genre', 'Set 1', 'Set 2', 'Set 3', 'Set 4', 'Set 5', 'Set 6', 'Set 7','Set 8',{ role: 'annotation' } ],
['18/7', 0, 0, 0, 0, 0, 0, 0, 2, ''],
['23/7', 0, 0, 0, 0, 0, 0, 0, 1, ''],
['24/7', 0, 0, 0, 0, 0, 0, 0, 4, ''],
['26/7', 0, 0, 0, 0, 0, 0, 0, 4, ''],
['29/7', 0, 0, 0, 0, 260, 0, 0, 0, ''],
['31/7', 0, 0, 0, 0, 0, 0, 0, 1, ''],
['2/8', 0, 0, 0, 0, 0, 0, 9, 0, ''],
['3/8', 0, 0, 132, 0, 0, 0, 0, 0, ''],
['4/8', 0, 0, 0, 0, 0, 0, 0, 11, ''],
['8/8', 0, 0, 0, 0, 0, 0, 0, 0, ''],
['13/8', 0, 83, 0, 0, 0, 0, 0, 0, ''],
['14/8', 215, 0, 0, 0, 0, 0, 0, 0, ''],
['15/8', 0, 0, 0, 72, 0, 0, 0, 0, ''],
['16/8', 0, 0, 0, 0, 0, 34, 0, 0, ''],
]);
// Set chart options
var options = {
title: '% of photos', fontSize: '12', backgroundColor: "transparent",
colors: ['#F56363', '#eda15f', '#40C1A0', '#FFD586', '#81CFE0', '#fcfcfc', '#A06C90', '#FFCAD1'],
};
// Set chart options
var options2 = {
title: '# of photos', backgroundColor: "transparent",
colors: ['#F56363', '#eda15f', '#40C1A0', '#FFD586', '#81CFE0', '#fcfcfc', '#A06C90', '#FFCAD1'],
legend: { position: 'bottom', maxLines: 3 },
bar: { groupWidth: '99%' },
isStacked: true,
};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
var chart2 = new google.visualization.ColumnChart(document.getElementById('chart_div2'));
chart2.draw(data2, options2);
}
</script>
谢谢您的时间。虽然可能有一种通过编程实现的方法,但您可以使用CSS将元素作为目标:
<style>
path[d="M811,150L823,150L817,162Z"] {fill: purple;}
或者干脆
path[d^="M811"] {fill: purple;}
</style>
虽然可能有一种方法可以通过编程实现,但您可以使用CSS将元素作为目标:
<style>
path[d="M811,150L823,150L817,162Z"] {fill: purple;}
或者干脆
path[d^="M811"] {fill: purple;}
</style>
您可以使用legend.scrollArrows.activeColor和legend.scrollArrows.inactiveColor设置这些。legend.pagingTextStyle.color也可用
在您的情况下,它将类似于:
var options2 = {
title: '# of photos', backgroundColor: "transparent",
colors: ['#F56363', '#eda15f', '#40C1A0', '#FFD586', '#81CFE0', '#fcfcfc', '#A06C90', '#FFCAD1'],
legend: { position: 'bottom', maxLines: 3, scrollArrows: { inactiveColor: "red", activeColor: "red" } },
bar: { groupWidth: '99%' },
isStacked: true
};
您可以使用legend.scrollArrows.activeColor和legend.scrollArrows.inactiveColor设置这些。legend.pagingTextStyle.color也可用
在您的情况下,它将类似于:
var options2 = {
title: '# of photos', backgroundColor: "transparent",
colors: ['#F56363', '#eda15f', '#40C1A0', '#FFD586', '#81CFE0', '#fcfcfc', '#A06C90', '#FFCAD1'],
legend: { position: 'bottom', maxLines: 3, scrollArrows: { inactiveColor: "red", activeColor: "red" } },
bar: { groupWidth: '99%' },
isStacked: true
};
你能解释一下我应该在哪里加上这个吗?我把它添加到我的css中,但它似乎不起作用。我想我算出来了,向下箭头的M811应该是M273,向上箭头的应该是M246。有人能给我解释一下M273、M811等代表什么吗?为什么伊舍伍德看到的号码和我不一样?很高兴你找到了。这个方法有点脆弱,因为它依赖于元素总是具有那个属性。你能解释一下我应该在哪里添加这个吗?我把它添加到我的css中,但它似乎不起作用。我想我算出来了,向下箭头的M811应该是M273,向上箭头的应该是M246。有人能给我解释一下M273、M811等代表什么吗?为什么伊舍伍德看到的号码和我不一样?很高兴你找到了。这种方法有点脆弱,因为它依赖于始终具有该属性的元素。谢谢,它就像一种魅力!想一想你是否也可以指向任何你发现这一点的文档。因为我在任何地方都找不到这些细节!谢谢,它很有魅力!想一想你是否也可以指向任何你发现这一点的文档。因为我在任何地方都找不到这些细节!