jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Color Bands
Tagged: chart, Color Bands, data, jqxChart, range, rangecolumn, source
This topic contains 4 replies, has 2 voices, and was last updated by boo 11 years, 3 months ago.
-
AuthorColor Bands Posts
-
Hi,
I am using color bands (of jqxGrid) in demo page and designing a time line of some staff tasks in a company.
In page sample, data array is like in following ;var data = [
{ Person: “Planning”, M1_From: 2, M1_To: 5, M2_From: 5, M2_To: 10 },
{ Person: “Dev 1”, M1_From: 5, M1_To: 7, M2_From: 9, M2_To: 17 },
{ Person: “Dev 2”, M1_From: 5, M1_To: 12, M2_From: 14, M2_To: 22 },
{ Person: “QA 1”, M1_From: 7, M1_To: 14, M2_From: 14, M2_To: 25 }
];There are unique keys in each lines of array for lines of color bands such as Person, M1, M2 etc.
In my design, i want to write more same keys. For example;var data = [
{ Person: “Planning”, M1_From: 2, M1_To: 5, M1_From: 5, M1_To: 10 },
{ Person: “Dev 1”, M2_From: 5, M2_To: 7, M2_From: 9, M2_To: 17 },
{ Person: “Dev 2”, M1_From: 5, M1_To: 12, M2_From: 14, M2_To: 22 },
{ Person: “QA 1”, M1_From: 7, M1_To: 14, M2_From: 14, M2_To: 25 }
];i can edit my array like this but when jqxGrid object uses my array which has more same keys, it shows only last key. For first line, there is just M1_From: 5 and M1_To: 10, for second line, there is just M2_From: 9 M2_To: 17.
How can i solve this problem?
Regards,
Orcun.
Hello Orcun,
I assume you are working with jqxChart, not jqxGrid.
Unfortunately, there is no way to add more than one field with the same name in a data object. However, you may share what your ultimate goal is and we might be able to find a workaround on the matter.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/sorry, you’re right, it must be jqxChart. My data and series arrays are like ;
var staff_list = [ { Name: 'Alper' }, { Name: 'Bilgehan' }, { Name: 'Orçun' , From6: 7, To6: 11, From6: 13, To6: 22 }, { Name: 'Deniz' , From2: 12, To2: 31 }, { Name: 'Kutay' }, { Name: 'Çağrı' }, { Name: 'Serhat' , From1: 3, To1: 12, From7: 13, To7: 20, From4: 13, To4: 24, From4: 24, To4: 27 }, { Name: 'Gamze' }, { Name: 'Ahmet' , From7: 5, To7: 10 }, { Name: 'Ramazan' } ]; var series_array = [ { dataFieldFrom: 'From1', dataFieldTo: 'To1', displayText: 'Genel', opacity: 1 }, { dataFieldFrom: 'From2', dataFieldTo: 'To2', displayText: 'PAROS', opacity: 1 }, { dataFieldFrom: 'From3', dataFieldTo: 'To3', displayText: 'Vinç', opacity: 1 }, { dataFieldFrom: 'From4', dataFieldTo: 'To4', displayText: 'Sis', opacity: 1 }, { dataFieldFrom: 'From5', dataFieldTo: 'To5', displayText: 'OCR', opacity: 1 }, { dataFieldFrom: 'From6', dataFieldTo: 'To6', displayText: 'YUTS', opacity: 1 }, { dataFieldFrom: 'From7', dataFieldTo: 'To7', displayText: 'ER-LINK', opacity: 1 } ];
For instance, the person whose name is Orçun has two From6-To6 tasks in same month. Thus, i want to see two separate time lines which follows each other in my color bands chart but it is like ;
Orçun has one time line which is from 13. day to 22. day, first From6-To6 is lost. The problem is here.
I know it is normal situation in javascript array, i can not add two different elements with one key name.
Can i solve it via another approach for jqxChart? Otherwise, do i have to use different things?Regards,
Orcun.
Hi Orcun,
Unfortunately, jqxChart does not support this functionality. The only similar approach is what you already did for “Serhat” – multiple ranges with different names. You can name the first range “YUTS – Part 1” and the second “YUTS – Part 2” and colour them the same way with the series property color.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Thank you so much again.
Regards,
Orcun.
-
AuthorPosts
You must be logged in to reply to this topic.