jQWidgets Forums

jQuery UI Widgets Forums Chart Value os xAxis on the colorfunction

This topic contains 4 replies, has 2 voices, and was last updated by  Peter Stoev 10 years, 5 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Value os xAxis on the colorfunction #65284

    cenergistic
    Participant

    is there a way to get the value of the xAxis at the color function? in my case the xAxis value would be 2:00 and the yAxis would be 44. The color function give me 44 but I need the 2:00 value as well

    vm.chartSettings = {
    			title: "24HR Period of Data",
    			description: "Kilowatts per Hour",
    			showLegend: true,
    			source: vm.source,
    			enableAnimations: true,
    			padding: { left: 5, top: 5, right: 50, bottom: 5 },
    			titlePadding: { left: 90, top: 0, right: 0, bottom: 10 },
    			xAxis:
    				{
    					dataField: 'Hour',
    					showGridLines: true
    				},
    			colorScheme: 'scheme01',
    			seriesGroups:
    				[
    					{
    						type: 'column',
    						columnsGapPercent: 50,
    						valueAxis:
    						{
    							unitInterval: 350,
    							displayValueAxis: true,
    							description: 'KW'
    						},
    						series: [
    								{
    									dataField: 'KW',
    									displayText: 'KW',
    									colorFunction: function (value, itemIndex, serie, group, categoryValue, categoryAxis) {
    										return vm.setBarColor(value, itemIndex, serie, group, categoryValue, categoryAxis);
    									}
    								},
    						]
    					}
    				]
    		};

    Thanks

    Value os xAxis on the colorfunction #65289

    Peter Stoev
    Keymaster

    Hi cenergistic,

    Have you tried the “categoryValue” param?

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Value os xAxis on the colorfunction #65309

    cenergistic
    Participant

    Both the categoryValue and the categoryAxis come as undefined on the function. I trioed that yesterday when I saw them used on the tooltip formatting.

    Thanks

    Value os xAxis on the colorfunction #65314

    Peter Stoev
    Keymaster

    Hi cenergistic,

    Then, please provide jsfiddle.net sample which illustrates your issue.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Value os xAxis on the colorfunction #65407

    Peter Stoev
    Keymaster

    Hi cenergistic,

    Actually, the problem here seems to be related to your colorFunction definition. It does not have the arguments which you defined. See below:

     colorFunction: function (value, itemIndex, serie, group) {
                                            if (!isNaN(itemIndex) && serie) {
                                                var xAxisValue = settings.source.records[itemIndex][settings.xAxis.dataField];
                                            }

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.