Javascript 如何在jqPlot中将轴标签斜体化?
即使jqplot插件本机不支持,jqplot图图例中的标签等元素也可以通过css进行修改。但是,由于jqPlot使用画布绘制这些图表,因此x轴和y轴标签有点棘手。我尝试使用JQQuery获取画布元素并更改其字体属性,如下所示,但没有结果。我是在情节呈现后才这样做的,我做错什么了吗Javascript 如何在jqPlot中将轴标签斜体化?,javascript,jquery,html,css,canvas,Javascript,Jquery,Html,Css,Canvas,即使jqplot插件本机不支持,jqplot图图例中的标签等元素也可以通过css进行修改。但是,由于jqPlot使用画布绘制这些图表,因此x轴和y轴标签有点棘手。我尝试使用JQQuery获取画布元素并更改其字体属性,如下所示,但没有结果。我是在情节呈现后才这样做的,我做错什么了吗 // this gets the correct canvas element and even highlights on the page in debugger mode var canvas = $('#Cha
// this gets the correct canvas element and even highlights on the page in debugger mode
var canvas = $('#Chart8Bar .jqplot-yaxis .jqplot-yaxis-tick').get(0);
// however when I call this getContext method, it no longer shows up highlighted in debugger mode but none the less comes back with the context element
var ctx = canvas.getContext("2d");
// this correctly sets the font and is reflected in the debugger but nothing happens on the page.
ctx.font = "italic 10px Courier";