jqplot

Jqplot show only few x axis ticks

荒凉一梦 提交于 2019-12-02 07:11:11
问题 I have to create a bar graph which shows a graph for 30 days. So I will show total 30 bars on the chart. But it looks very congested on the x axis. Is there a way where I can show only 6 x-axis ticks and not all the 30 x axis ticks? 回答1: I know that this is an old question but I need some solution too so here it is: When you use jqplot to print bars you can't say it how many ticks it should print because it prints only related values so you have to print all ticks. My solution is not nice but

Print issue with JQplot on IE

萝らか妹 提交于 2019-12-02 05:56:16
I am trying to print my graph and it prints properly through Firefox and Chrome. But if i try to print it with IE, it shows me the graph canvas HTML tags behind the graph. as u seen in the image. and also it placed the graph axis text all over the graph.. :( i tried the below solution which says it resolves the issue but it dint for me :( http://blog.muonlab.com/2010/06/02/getting-position-absolute-canvas-elements-to-print-correctly-in-ie/ below screenshot of the issue. HTML <!doctype html> <html lang="en" class="no-js master"> <head> <!-- jQuery Flot Graph Widget. exCanvas.js needed for IE --

Jqplot show only few x axis ticks

北城余情 提交于 2019-12-02 04:33:02
I have to create a bar graph which shows a graph for 30 days. So I will show total 30 bars on the chart. But it looks very congested on the x axis. Is there a way where I can show only 6 x-axis ticks and not all the 30 x axis ticks? I know that this is an old question but I need some solution too so here it is: When you use jqplot to print bars you can't say it how many ticks it should print because it prints only related values so you have to print all ticks. My solution is not nice but it works. Just print ticks with empty label. For example: axes: { xaxis: { min:1, max: 30, ticks: [[1,""],

jqplot Pie Chart data label format precision without trailing zeros

吃可爱长大的小学妹 提交于 2019-12-02 04:28:14
I would like to know how to format the data labels on a Pie Chart so it shows max 2 decimal characters, and never shows trailing zeros , for example: 2 -> 2 2.0 -> 2 2.566 -> 2.57 In other words, I am asking how to set dataLabelFormatString parameter ? I know it is using sprintf , thus I tried '%.2f' and '%g'. They do not solved my problem though. Since the first makes each number to show to decimal characters, the other just removes trailing zeros but doesn't work with precision as in this case the digits you place in front of it ,e.g. '%.2g' refer to the total length of the character. I do

jqplot axis tick labels with ellipsis

牧云@^-^@ 提交于 2019-12-02 03:49:13
问题 I have an app that creates several charts using jqplot . Here is an example of one of the charts I'm having trouble with: As you can see some of the tick labels are quite long and causing the chart to render incorrectly. I am using $.jqplot.CanvasAxisTickRenderer in order to rotate the tick labels as shown so I don't think I can style the tick label text using CSS. Is there a way I can shorten the tick label text using CSS or a formatter. I'm looking for an effect that simply shortens the

PrimeFaces print doesn't work with p:chart

北战南征 提交于 2019-12-02 03:33:00
问题 I'm using primeface print just like below <ui:define name="content" id="content"> <h:form id="common_chart_form" prependId="flase"> <p:growl id="growl" showDetail="true" autoUpdate="true" sticky="false" /> <p:outputLabel id="labelvalue" value="aaaaaaaaaa"/> <p:chart id="chart" type="bar" model="#{commonChartController.barModel}" style="height:300px" /> <p:commandButton value="Print" type="button" icon="ui-icon-print"> <p:printer target="chart" /> </p:commandButton> <p:commandButton value=

How to display the JQPLOT graph rather a long text

余生长醉 提交于 2019-12-01 21:21:42
问题 I have a method in controller class which returns JSON data: public ActionResult ChartDataJSON() { Chart chart = new Chart(); DataSet ds = dbLayer.GetChartData(); DataTable dtChartData = ds.Tables[0]; List<jqplotModel> chartData = new List<jqplotModel>(); if (dtChartData .Rows.Count != 0) { foreach (DataRow row in dtChartData .Rows) { chartData.Add(new jqplotModel{ Date = DateTime.Parse(@row["Date"].ToString()), Demand= Convert.ToDouble(@row["Demand"].ToString()), Supply= Convert.ToDouble(

IE8 Printing issues with Jqplot

*爱你&永不变心* 提交于 2019-12-01 20:53:27
I am testing jqplot with IE8. When I tried to print, the axes labels were offset. I used Andrew Bullock's Canvashack as a workaround.( http://blog.muonlab.com/2010/06/02/getting-position-absolute-canvas-elements-to-print-correctly-in-ie/ ) It still did not fix the issue. I am new to scripting. Is there anything wrong with my code? Please help. Thanks, Shu <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head profile="http://gmpg.org/xfn/11"> <head> <meta http-equiv="Content

How to display the JQPLOT graph rather a long text

折月煮酒 提交于 2019-12-01 19:40:41
I have a method in controller class which returns JSON data: public ActionResult ChartDataJSON() { Chart chart = new Chart(); DataSet ds = dbLayer.GetChartData(); DataTable dtChartData = ds.Tables[0]; List<jqplotModel> chartData = new List<jqplotModel>(); if (dtChartData .Rows.Count != 0) { foreach (DataRow row in dtChartData .Rows) { chartData.Add(new jqplotModel{ Date = DateTime.Parse(@row["Date"].ToString()), Demand= Convert.ToDouble(@row["Demand"].ToString()), Supply= Convert.ToDouble(@row["Supply"].ToString()) }); } } return Json(chartData, JsonRequestBehavior.AllowGet); } Does anybody

How can I hide the points that are displayed on the plot chart?

孤人 提交于 2019-12-01 18:01:54
I have the following jqPlot chart: $(document).ready(function () { var line1 = new Array(); @foreach (var item in Model) { <text>line1.push(["@item.VisitDate.Value.ToString("dd-MMM-yyyy")", @item.count]);</text> } var plot1 = $.jqplot('chart1', [line1], { title: '<span style="Color: Green " >Number Of Visits</span>', axesDefaults: { pad: 1.2 }, axes: { xaxis: { renderer: $.jqplot.DateAxisRenderer, tickOptions: { formatString: '%d/%b/%Y' } }, yaxis: { tickOptions: { formatString: '%.2f'} } }, highlighter: { show: true, sizeAdjust: 7.5, tooltipLocation: 'nw' // , formatString: '<b>%s</b>' },