load row data on modify header tcpdf codeigniter - codeigniter

I am little confused here,
I am using TCPDF to print a pdf from Codeigniter.
The TCPDF directory putted in application/library
I wanna load a row from a model to a TCPDF header that I modified, because
The header will be viewing some data like serial number from model.
The model is like this :
class model_request extends CI_Model{
public function __construct(){
parent::__construct();
}
public function selectOneRequest($id_request){
$query = $this->db->get_where('tbl_requestfix', array('id_request'=>$id_request));
return $query->result_array();
}
}
and this is the mypdf class that extending header dan footer of tcpdf class
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once dirname(__FILE__) . '/tcpdf/tcpdf.php';
class TC_Pdf extends TCPDF{
//Page header
public function Header() {
// Set font
$this->SetFont('helvetica', '', 10);
// Serial number
$this->Cell(0, 15, 'I am missing here', 0, true, 'R', 0, '', 0, false, 'M', 'M');
$this->SetFont('helvetica', 'B', 16);
$this->Cell(0, 15, 'P.T. Tresnamuda Sejati', 0, true, 'C', 0, '', 0, false, 'M', 'M');
$this->SetFont('helvetica', '', 11);
$this->Cell(0, 15, 'FORM PERMINTAAN / PERBAIKAN ', 0, true, 'C', 0, '', 0, false, 'M', 'M');
$this->SetFont('helvetica', 'B', 16);
$this->Cell(0, 15, 'HARDWARE - SOFTWARE - NETWORK', 0, true, 'C', 0, '', 0, false, 'M', 'M');
}
// Page footer
public function Footer() {
// Position at 15 mm from bottom
$this->SetY(-10);
// Set font
$this->SetFont('helvetica', 'I', 8);
// Page number
//$this->Cell(0, 0, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
}
}
This is my controller to fill the body of pdf :
public function generate_pdf($idRequest){
$data=$this->model_request->selectOneRequest($idRequest);
foreach ($data as $d) {
$this->load->library("TC_PDF");
$pdf = new TC_Pdf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Dzil');
$pdf->SetTitle('Form Perbaikan / Permintaan');
$pdf->SetSubject('TMS/DEPT/IT/06');
$pdf->SetKeywords('TCPDF, PDF, form, perbaikan, Permintaan');
// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);
// set header and footer fonts
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
if (#file_exists(dirname(__FILE__).'/lang/eng.php')) {
require_once(dirname(__FILE__).'/lang/eng.php');
$pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
$pdf->SetFont('helvetica', '', 12);
// add a page
$pdf->AddPage();
$pdf->Ln(8);
$pdf->Cell(30, 8, 'Nama', 1, 0, 'L', 0, '', 0, false, 'T', 'C');
$pdf->Cell( 4, 8, ': ', 1, 0, 'L', 0, '', 0, false, 'T', 'C');
$pdf->Cell( 0, 8, $d['nama_user'], 1, 1, 'L', 0, '', 0, false, 'T', 'C');
$pdf->Cell(30, 8, 'Departement', 1, 0, 'L', 0, '', 0, false, 'T', 'C');
$pdf->Cell( 4, 8, ': ', 1, 0, 'L', 0, '', 0, false, 'T', 'C');
$pdf->Cell( 0, 8, $d['departement'], 1, 1, 'L', 0, '', 0, false, 'T', 'C'); //w,h,isi, border
$pdf->Cell(30, 8, 'NIK', 1, 0, 'L', 0, '', 0, false, 'T', 'C');
$pdf->Cell( 4, 8, ': ', 1, 0, 'L', 0, '', 0, false, 'T', 'C');
$pdf->Cell( 0, 8, $d['id_user'], 1, 1, 'L', 0, '', 0, false, 'T', 'C');
$pdf->Cell(30, 8, 'Tanggal', 1, 0, 'L', 0, '', 0, false, 'T', 'C');
$pdf->Cell( 4, 8, ': ', 1, 0, 'L', 0, '', 0, false, 'T', 'C');
$pdf->Cell( 0, 8, $d['waktu_mulai'], 1, 1, 'L', 0, '', 0, false, 'T', 'C');
// reset pointer to the last page
$pdf->lastPage();
// ---------------------------------------------------------
//Close and output PDF document
$pdf->Output('example_057.pdf', 'I');
//echo $d["kode_kantor"];
}
}
How should I do, coz in mypdf class that extend tcpdf class, I can not load that model ...
Any help it so appriciated...

Have you load that model in your controller?
insert this before calling the model.
public function generate_pdf($idRequest){
$this->load->model('model_request'); // <-- insert this
$data=$this->model_request->selectOneRequest($idRequest);
...
}

Related

Laravel sortBy multiple values and multiple keys

I'm trying to figure out the best way to sort by multiple values and multiple keys at once.
I have the following "sort sequence";
sort by "finished or not"
sort by "out of time or not"
sort by "points in total"
sort by "points for your time"
sort by "points for each 'secret time control', can be null, then you end up at the end of that sorting"
sort by "the distance driven"
I currently have something like this of response (sorted);
[
{
"team_number": 201,
"points_for_time": 0,
"detail_points_for_time": {
"tc_start": 0,
"tc_round_in": 0,
"tc_stop": 0
},
"points_for_gtc": 1,
"detail_points_for_gtc": [
0,
1
],
"points_for_distance": 0,
"missed_controls": 100,
"out_of_time": false,
"dnf": false,
"total": 101
},
{
"team_number": 202,
"points_for_time": 2,
"detail_points_for_time": {
"tc_start": 0,
"tc_round_in": 0,
"tc_stop": 2
},
"points_for_gtc": 0,
"detail_points_for_gtc": [],
"points_for_distance": 0,
"missed_controls": 100,
"out_of_time": false,
"dnf": false,
"total": 102
},
{
"team_number": 203,
"points_for_time": 0,
"detail_points_for_time": 0,
"points_for_gtc": 0,
"detail_points_for_gtc": 0,
"points_for_distance": 0,
"missed_controls": 0,
"out_of_time": false,
"dnf": true,
"total": 0
},
{
"team_number": 204,
"points_for_time": 0,
"detail_points_for_time": 0,
"points_for_gtc": 0,
"detail_points_for_gtc": 0,
"points_for_distance": 0,
"missed_controls": 0,
"out_of_time": false,
"dnf": true,
"total": 0
},
{
"team_number": 205,
"points_for_time": 0,
"detail_points_for_time": 0,
"points_for_gtc": 0,
"detail_points_for_gtc": 0,
"points_for_distance": 0,
"missed_controls": 0,
"out_of_time": false,
"dnf": true,
"total": 0
},
{
"team_number": 206,
"points_for_time": 0,
"detail_points_for_time": 0,
"points_for_gtc": 0,
"detail_points_for_gtc": 0,
"points_for_distance": 0,
"missed_controls": 0,
"out_of_time": false,
"dnf": true,
"total": 0
},
{
"team_number": 207,
"points_for_time": 0,
"detail_points_for_time": 0,
"points_for_gtc": 0,
"detail_points_for_gtc": 0,
"points_for_distance": 0,
"missed_controls": 0,
"out_of_time": false,
"dnf": true,
"total": 0
},
{
"team_number": 208,
"points_for_time": 0,
"detail_points_for_time": 0,
"points_for_gtc": 0,
"detail_points_for_gtc": 0,
"points_for_distance": 0,
"missed_controls": 0,
"out_of_time": false,
"dnf": true,
"total": 0
},
{
"team_number": 209,
"points_for_time": 0,
"detail_points_for_time": 0,
"points_for_gtc": 0,
"detail_points_for_gtc": 0,
"points_for_distance": 0,
"missed_controls": 0,
"out_of_time": false,
"dnf": true,
"total": 0
}
]
So the goal here is, that I get a full sorting based on the above "sequence".
I currentmy use this;
$results = $results->sortBy('total')
->sortBy('points_for_time')
->sortBy('points_for_gtc') // this is an issue, since it puts you below someone else when you have less points
->sortBy('points_for_distance')
->sortBy('out_of_time')
->sortBy('dnf');
There is another "field" I have, detail_points_for_gtc, which holds the points (in order) for each "time control".
The possibility exists that there is nothing filled in, if so, then you should be at the end of the list. it's also possible that the value is null. Then it should be sorted at the end.
I have no idea on how I can sort on the detail_points_for_gtc, and if this sorting is "the correct sorting"?
Anyone who understands the question and may be able to help?
I think you can try this;
// you can send column and direction from request or where you need
$results = $request->direction == 'asc' ? $results->sortBy($request->column) : $results->sortByDesc($request->column);

Elasticsearch: empty slices when using scroll api with slice

I have a simple setup with a green cluster (v7.5.2) of 1 instance with 1 index (replica 0) with 8 shards.
61,500 documents indexed.
If I create 8 slices with these queries (POST queries)
http://localhost:9202/products_dev/_search?scroll=10m: {'slice': {'field': 'created_at', 'id': 0, 'max': 8}, 'size': 1000}
http://localhost:9202/products_dev/_search?scroll=10m: {'slice': {'field': 'created_at', 'id': 1, 'max': 8}, 'size': 1000}
...
http://localhost:9202/products_dev/_search?scroll=10m: {'slice': {'field': 'created_at', 'id': 7, 'max': 8}, 'size': 1000}
for each slice I collect the first hits of each slice and get those lengths:
[1000, 0, 0, 0, 0, 0, 0, 0]
Only 1 slice has results which is equivalent to not slicing the index in the first place.
I tried a max of 32 with those commands:
http://localhost:9202/products_dev/_search?scroll=10m: {'slice': {'field': 'created_at', 'id': 0, 'max': 32}, 'size': 1000}
http://localhost:9202/products_dev/_search?scroll=10m: {'slice': {'field': 'created_at', 'id': 1, 'max': 32}, 'size': 1000}
...
http://localhost:9202/products_dev/_search?scroll=10m: {'slice': {'field': 'created_at', 'id': 31, 'max': 32}, 'size': 1000}
for each slice I collect the first hits of each slice and get those lengths:
[1000, 0, 0, 0, 0, 0, 0, 0, 1000, 0, 0, 0, 0, 0, 0, 0, 1000, 0, 0, 0, 0, 0, 0, 0, 1000, 0, 0, 0, 0, 0, 0, 0]
This way I can scroll my index using 4 different (non-empty) slices but I had to create 32 contexts which is not ideal.
What am I doing wrong?
I tried to use a date as slice.field
"slice": {
"field": "created_at",
but it did not help.
My local index had so few documents, most of the documents where saved in 1 shard

How to use export excel and print for selected columns in datatable?

I want to use export excel and print the datatable .I use following code but not able to use both options for selected columns.
$('#example').DataTable( {
dom: 'Blfrtip',
buttons: [
{
extend: 'excel','print',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
},
}
],
"lengthMenu": [[200, 250, 500, -1], [200, 250, 500, "All"]],
"bLengthChange" : true,
initComplete: function () {
this.api().columns().every( function () {
var column = this;
var select = $('<select><option value="">Select</option></select>')
.appendTo( $(column.footer()).empty() )
.on( 'change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search( val ? '^'+val+'$' : '', true, false )
.draw();
} );
column.data().unique().sort().each( function ( d, j ) {
select.append( '<option value="'+d+'">'+d+'</option>' )
} );
} );
}
} );
I am not figure out what happens wrong.Please help me.
{
extend: 'excel'
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
},
{
extend: 'print'
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
}
One of the most commonly used is the columns option which defines the columns that should be used as part of the export. This is given as a column-selector, making it simple to tell it if you want only visible columns, or a mix of the columns available.
and this is a simple of how it can be done :
function attachDataTable(tableId: string) {
let companyFunctionTable = $('#' + tableId).DataTable({
dom: 'Bfrtip',
buttons: [
//'csvHtml5'
{
extend: 'csvHtml5',
exportOptions: {
columns: [0, 1, 2]
},
className: 'btn btn-sm btn-outline-secondary',
text: `<i class="fa fa-file-csv"></i> ${i18next.t('Export to CSV')}`, titleAttr: i18next.t('Export to CSV'),
bom: true
},
],
"initComplete": function (settings, json) {
placeToolbarButton(tableId);
},
"paging": globalVar.dataTablesSettings.paging,
"stateSave": false,
"stateSaveParams": function (settings, data: any) {
data.search.search = "";
},
"order": [],
"lengthChange": false,
"pageLength": globalVar.dataTablesSettings.pageLength,
"language": {
"url": globalVar.dataTablesSettings.languageUrl
}
});
}
Please fellow that link :
https://datatables.net/extensions/buttons/examples/html5/columns.html
Don't forget to include the required JS libraries needed to display the exporting functionality.
Just modify your buttons option this way
buttons: [
{
extend: 'excel',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
},
},
{
extend: 'print',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
},
},
]
elaborated #tdymicroit answer

Ful length row Handsontable

I'm looking for a excel like table for my app then at my search I saw this Handsontable but one also of my requirements is groupings on the table.
Is it possible at Handsontable a ful length row like this?
I'm not sure what you mean by 'full length row' but a couple of options that may help you are:
Rendering custom html
This allows you to manipulate both the headers and cells. Example:
var $container = $("#example2");
$container.handsontable({
colHeaders: function (col) {
switch (col) {
case 0: //First column header
return "<b>Bold</b> and <em>Beautiful</em>";
case 1: //Second column header
var txt = "Some <input type='checkbox' class='checker' ";
txt += isChecked ? 'checked="checked"' : '';
txt += "> checkbox";
return txt;
}
}
});
or
Column stretching
This lets you stretch a column to fill the row to a 'full length row'. Example option to stretch the last column:
stretchH: 'last'
I think what your looking at is merging cells. It exists two different ways to merge cells with HandsonTable.
You can either directly specify the merges you want in the options:
hot = new Handsontable(container, {
data: myData,
rowHeaders: true,
colHeaders: true,
contextMenu: true,
mergeCells: [
{row: 0, col: 0, rowspan: 1, colspan: 4}, // for description
{row: 3, col: 4, rowspan: 2, colspan: 2}, // any other merges
{row: 5, col: 6, rowspan: 3, colspan: 3}
]
});
or create an array with all the merges and give it later to the table:
var mergeArr = new Array();
var descriptionMerge = {
row : 0,
col : 0,
rowspan : 1,
colspan : 4
}
mergeArr.push(descritpionMerge);
hot = new Handsontable(container, {
data: myData,
rowHeaders: true,
colHeaders: true,
contextMenu: true,
mergeCells: mergeArr
});
row: starting row of the merge.
col: starting col of the merge.
rowspan: number of rows that will be merged from the starting row.
colspan: number of cols that will be merged from the starting col.
In your case, you want a full length row, so you need to merge cells in this way :
{row: yourStartingRow, col: yourStartingCol, rowspan: 1, colspan: lengthOfYourTable}
HandsonTable documentation: http://docs.handsontable.com/0.15.1/demo-merge-cells.html
Bonus: If you want to center the text in your merged cells, just use the className : "htMiddle" option.
http://docs.handsontable.com/0.17.0/demo-alignment.html
If you want to group headers, you can used the nested headers to do this:
The code uses the "NestedHeaders" tag like so:
var example1 = document.getElementById('example1');
var hot = new Handsontable(example1, {
data: Handsontable.helper.createSpreadsheetData(5,10),
colHeaders: true,
rowHeaders: true,
nestedHeaders: [
['A', {label: 'B', colspan: 8}, 'C'],
['D', {label: 'E', colspan: 4}, {label: 'F', colspan: 4}, 'G'],
['H', {label: 'I', colspan: 2}, {label: 'J', colspan: 2}, {label: 'K', colspan: 2}, {label: 'L', colspan: 2}, 'M'],
['N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W']
]
});
See more on the handsontable documentation

JQPlot Grouped Stacked graph with different colours

I am trying to produce the following graph with JQPlot
I have attempted this as best I can however the script causes an excsessive runtime and eventually firefox comes up with the stop script notice.
Any suggestions?
$(document).ready(function () {
var assigned1 = [5, 12, 2, 0, 0, 4, 8];
var assigned2 = [4, 0, 2, 0, 0, 2, 4];
var assigned3 = [1, 0, 2, 0, 0, 2, 0];
var assigned4 = [0, 0, 5, 0, 0, 3, 0];
var assigned5 = [0, 0, 1, 0, 0, 0, 0];
var assigned = [assigned1, assigned2, assigned3, assigned4, assigned5];
var numCompleted = [assigned1, assigned2, assigned3, assigned4, assigned5]; //[4,3,6,5,5,4,0,0,5,4,0,0,0,0];
//[1,1,0,0,2,2,8,7,4,4,11,10,1,1];
//var test3 = [4,6,3,8,6,3,1,9,1,5,3,6,7,4];
var dates = ['Assigned', 'Employee', 'Machine', 'Assigned', 'Employee', 'Machine', 'Assigned', 'Employee', 'Machine', 'Assigned', 'Employee', 'Machine', 'Assigned', 'Employee', 'Machine', 'Assigned', 'Employee', 'Machine', 'Assigned', 'Employee', 'Machine'];
plot3 = $.jqplot('chart3', [assigned, numCompleted], {
// Tell the plot to stack the bars.
seriesColors: ["#81a7d4", "#d0d0d0", "#fac"],
stackSeries: true,
shadow: false,
title: 'Cell Name',
animate: false,
captureRightClick: false,
grid: {
drawGridLines: false,
shadow: false
},
legend: {
show: false,
},
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
rendererOptions: {
barMargin: 10,
barPadding: 0,
shadowOffset: 0,
groups: 7,
highlightMouseDown: true
},
pointLabels: {
show: true,
hideZeros: true,
edgeTolerance: 10
}
},
grid: {
gridLineColor: '#fff',
borderWidth: 0,
shadow: false,
background: "white"
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: dates,
showTickMarks: false
},
yaxis: {
showTicks: false
}
}
});
});
http://jsfiddle.net/K5cjj/1/
I have managed to do this by drawing multiple graphs to the same element. This has other issue but appears to work, can anyone expand on this to enable the click function to work on all bars
However this works in Firefox, chrome and IE11 only, IE 10 and below is all messed up (as usual)
http://jsfiddle.net/LADzf/1
$(document).ready(function(){
/* graph config */
var maxVal = 13;
/* graph vals */
var assigned1 = [5, 0, 0, 0, 12, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 8, 0, 0];
var assigned2 = [3, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0];
var assigned3 = [2, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0];
var assigned4 = [0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var employee1 = [0, 5, 0, 0, 0, 10, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 12, 0];
var employee2 = [0, 5, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var machine = [0, 0, 12, 0, 0, 0, 12, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 12];
var basevals = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
/* graph ticks */
var ticks = ['Assigned', 'Employee', 'Machine', ' ', 'Assigned', 'Employee', 'Machine', ' ', 'Assigned', 'Employee', 'Machine', ' ', 'Assigned', 'Employee', 'Machine', ' ', 'Assigned', 'Employee', 'Machine', ' ', 'Assigned', 'Employee', 'Machine', ' ', 'Assigned', 'Employee', 'Machine'];
var blankticks = [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '];
var dateticks = ['<br><br><br><br>01/01/2014', '<br><br><br><br>02/01/2014', '<br><br><br><br>03/01/2014', '<br><br><br><br>04/01/2014', '<br><br><br><br>05/01/2014', '<br><br><br><br>06/01/2014', '<br><br><br><br>07/01/2014'];
/* plot the base graph */
plotbase = $.jqplot('chart3', [basevals], {
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
rendererOptions: {barMargin: 10},
pointLabels: {show: false}
},
axesDefaults: {show: false},
tickOptions: {showMark: false, angle: 90},
axes: {
showLabel: false,
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: dateticks,
tickOptions: {markSize: 0}
},
yaxis: {
padMin: 0,
min: 0,
max: maxVal,
showLabel: false,
show: false
}
}
});
plot3 = $.jqplot('chart3', [machine], {
seriesColors: ["#a62525"],
stackSeries: true,
captureRightClick: true,
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
rendererOptions: {
barMargin: 10,
highlightMouseOver: true
},
pointLabels: {show: false}
},
axesDefaults: {show: false},
tickOptions: {showMark: false, angle: 90},
axes: {
showLabel: false,
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: blankticks,
tickOptions: {markSize: 0}
},
yaxis: {
padMin: 0,
min: 0,
max: maxVal,
showLabel: false,
show: false
}
}
});
plot2 = $.jqplot('chart3', [employee1, employee2], {
seriesColors: ["#67ce64", "#da9831"],
stackSeries: true,
captureRightClick: true,
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
rendererOptions: {barMargin: 10, highlightMouseOver: true},
pointLabels: {show: false}
},
axesDefaults: {show: false},
tickOptions: {showMark: false},
axes: {
showLabel: false,
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: blankticks
},
yaxis: {
padMin: 0,
min: 0,
max: maxVal,
showLabel: false,
show: false
}
},
grid: {background: 'transparent', drawGridLines: false, gridLineColor: 'transparent', borderColor: 'transparent'}
});
plot1 = $.jqplot('chart3', [assigned1, assigned2, assigned3, assigned4], {
stackSeries: true,
captureRightClick: true,
seriesColors: ["#effa38", "#37d1f8", "#5129b6"],
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
rendererOptions: {barMargin: 10, highlightMouseOver: true },
pointLabels: {show: false}
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
tickRenderer:$.jqplot.CanvasAxisTickRenderer,
ticks: ticks,
tickOptions: {
angle: -90,
}
},
yaxis: {
padMin: 0,
min: 0,
max: maxVal
}
}, grid: {background: 'transparent', drawGridLines: false, gridLineColor: 'transparent', borderColor: 'transparent'}
});
$('#chart3').bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) {
$('#info3').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);
});
});

Resources