gpt4 book ai didi

javascript - JqPlot - LINE 和 FILL 的不同颜色如何?

转载 作者:行者123 更新时间:2023-11-30 17:25:53 25 4
gpt4 key购买 nike

我一直在努力实现这样的目标:

Check charts line and fill colors

这正是我所需要的。你知道如何让线条和填充颜色不同吗?

谢谢

这就是我的脚本:

        <script type="text/javascript">
$('#btnResetHeartRateZoom').show();
var data = [@string.Join(",", Model.Activity.Laps.SelectMany(t => t.TrackPoints).Select(h => h.HeartRate))];
var HeartRatePlot = $.jqplot('HeartInformation', [data],
{
seriesColors: ['#85802b'],
title: "@Resources.HeartRate",
axesDefaults: { labelRenderer: $.jqplot.CanvasAxisLabelRenderer }, //Render de los textos.
series: [{ showMarker: false, fill: true, color: '#FCB1B8' }], //Para no mostrar markers.
axes:
{
xaxis: { autoscale: true, label: "@Resources.Distance", pad: 0 },
yaxis: { autoscale: true, label: "@Resources.HeartRate [bpm]" },
},
highlighter: { show: true, sizeAdjust: 7.5 },
cursor: { show: true, zoom: true }
});

$('#btnResetHeartRateZoom').click(function () { HeartRatePlot.resetZoom(); });
</script>

这是我的结果:

This is my plot

最佳答案

对于个人Series , 你可以启用 fillAndStroke绘制填充和线条:

If true will stroke the line (with color this.color) as well as fill under it. Applies only when fill is true.

fillColor指定第二种颜色:

CSS color spec to use for fill under line. Defaults to line color.

示例:http://jsfiddle.net/rjDgh/

series: [
{ ..., fill: true, fillAndStroke: true, color: '#FCB1B8', fillColor: '#ccc' }
]

关于javascript - JqPlot - LINE 和 FILL 的不同颜色如何?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24288720/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com