Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/403.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在jqPlot中将轴标签斜体化?_Javascript_Jquery_Html_Css_Canvas - Fatal编程技术网

Javascript 如何在jqPlot中将轴标签斜体化?

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

即使jqplot插件本机不支持,jqplot图图例中的标签等元素也可以通过css进行修改。但是,由于jqPlot使用画布绘制这些图表,因此x轴和y轴标签有点棘手。我尝试使用JQQuery获取画布元素并更改其字体属性,如下所示,但没有结果。我是在情节呈现后才这样做的,我做错什么了吗

// 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";