I'm trying to fix my cfchart in CF11 to look some similar like in previous CF9. I converted my .xml files and instead I use JSON to style my elements. Problem that I can not fix is cfchartseries. My data that i'm passing in my chartseries looks good, I tried to output everything on the screen before I tested my chart. In CF9 my Time records were displayed on the screen from the first value all the way up to the last value. Here is my screen shot of my chart in CF9:
As you can see on the picture above all my time slots are displayed on the screen in order from the lowest to the highest. Also my record for 2015 is displayed with the bar in blue color, 2016 in pink color. Now I will show you my chart with the exact same code in CF11:
You can see thatmy chart in CF11 starts with the blue bar that present year 2015 and time slot that should not be on the first spot 1415. Also my other time slots are not displayed on the screen. I have tried so hard to get this done but still did not find any solutions. I'm wondering if anyone can help with this problem. Below is my code and I will show you both codes for CF9 and CF11.
Code for chart in CF9:
<cfchart format="#ffPrint#" xaxistitle="#desc#" yaxistitle="#yTitle#" style="ChartStyle.xml"
chartheight="700" chartwidth="#graphWidth#" title="#title#" showlegend="#theLegend#" >
<cfchartseries type="bar" itemcolumn="Spacer" valuecolumn="" seriescolor="white" >
<cfoutput>
<cfloop list="#dataList#" index="i">
<cfchartdata item="#i#" value="0">
</cfloop>
</cfoutput>
</cfchartseries>
<cfoutput query="getRecords" group="theYear">
<cfchartseries type="bar" itemcolumn="#theYear#" valuecolumn="theCount" seriescolor="#listGetAt(theColors,colorIndex)#" >
<cfset colorIndex++>
<cfoutput>
<cfchartdata item="#Description#" value="#theCount#">
</cfoutput>
</cfchartseries>
</cfoutput>
</cfchart>
Code for my chart in CF11:
<cfchart format="html" xaxistitle="#desc#" yaxistitle="#yTitle#" style="#cStyle#"
chartheight="700" chartwidth="#graphWidth#" title="#newTitle2#" showlegend="#theLegend#">
<cfoutput query="getRecords" group="theYear">
<cfchartseries type="bar" itemcolumn="#theYear#" valuecolumn="theCount" seriescolor="#listGetAt(theColors,colorIndex)#" serieslabel="#theYear#">
<cfset colorIndex++>
<cfoutput>
<cfchartdata item="#Description#" value="#theCount#">
</cfoutput>
</cfchartseries>
</cfoutput>
</cfchart>
In order to get any records in CF11 I had to remove my first CFCHARTSERIES, still if I have combination of 2015 and 2016 years records my chart does not display values on the screen. I think that problem is in CFCHARTSERIES but I do not what should be changed to fix this issue. If anyone can help please let me know.
Thanks in advance!
Related
OVERVIEW:
We are using this plugin -- bootstrap-datetimejs (https://github.com/Eonasdan/bootstrap-datetimepicker). And I have it setup to show the time only
$(".timePicker").datetimepicker({
format: 'LT'
});
We are using ractivejs for our javascript library and my html goes like this
<label for="apptEndTime">End Time</label>
<div class="timePicker">
<input name="apptEndTime" id="apptEndTime" class="form-control date" type="text" value="{{apptEndTime}}" />
</div>
<label>Duration (mins)</label>
<input type="number" class="form-control" value="{{duration}}" id="duration" />
so apptEndTime is binded to ractive object data apptEndTime, and so does the duration. In my code, I made it that if the duration increases, it will also update the value of apptEndTime data. It successfully updated and displayed the apptEndTime.
PROBLEM:
Though it successfully updated and displayed the apptEndTime, when I click the clock icon of the datetimepicker, it still shows the previous time. As you can see on the screenshot below, it already displayed as 11:58 PM but when I click the clock icon, it still shows as 11:57 PM
QUESTION:
Is there a way that when I updated the value of apptEndTime, the time on the time selection menu (when the clock icon is clicked) will also gets updated?
I've already tried googling for day regarding this, but I can't seem to find the right solution. Also tried checking the documentation but can't find any related information
Ok my teammate was able to answer this question. He just added this line of code
$('input[name=appEndTime]').closest('.timePicker').data("DateTimePicker").date(appointmentObj.apptEndTime);
Where:
$('input[name=appEndTime]') is the affected input field
closest('.timePicker'). The '.timePicker' here is the name of your datetimepicker class/id when you initialize datetimepicker
data("DateTimePicker"). You just follow this, because all functions should be accessed via data("DateTimePicker") as mentioned on the plugin page:
https://getdatepicker.com/4/Functions/
date(appointmentObj.apptEndTime). date is the function name (though it is not found on the list of functions from their page :( ). And appointmentObj.apptEndTime is value that I want to set on the menu
I am trying to create a pie chart that expands a pie slice when it is clicked as shown in this example.
Below is my ColdFusion code which, according to the ZingChart docs, allows a detach property to be set to true that should allow this behavior. It does not seem to be working however. The line-style property that I set works but not the detach property. Any help would be appreciated. Thanks!
<cfset plot = {"line-style":"dotted","detach": "true"}>
<cfchart format="html" title="Sales Report" plot="#plot#">
<cfchartseries type="pie">
<cfchartdata item="2012" value="25">
<cfchartdata item="2013" value="25">
<cfchartdata item="2014" value="25">
<cfchartdata item="2015" value="25">
</cfchartseries>
</cfchart>
Full disclosure, I'm a member of the ZingChart team.
The detached property does not work because the build cfcharts currently uses is not up to date with the build that the detached property was added.
I have a form that is using the calendar/date selection tool within Ektron, but when users select the current date (or any date, for that matter), it gives an error saying that you need to select a date in the past.
We haven't tooled around in the code for this form, but it almost sounds like a validation issue.
Here's the code, as is, from Ektron.
<p align="center" style="text-align: left;">Date program was presented:
<ektdesignns_calendar title="Date presented" id="Date_presented" onblur="design_validate_xpath('number(translate(.,\'-\',\'\')) <= number(translate($currentDate,\'-\',\'\'))',this,'Date in the past (required)');" ektdesignns_name="Date_presented" ektdesignns_caption="Date presented" ektdesignns_invalidmsg="Date in the past (required)" ektdesignns_validate="xpath:number(translate(.,'-','')) <= number(translate($currentDate,'-',''))" ektdesignns_basetype="calendar" ektdesignns_datatype="date" ektdesignns_validation="datePast-req" name="Date_presented">
<input type="text" size="30" readonly="readonly" unselectable="on" />
<img width="16" height="16" class="design_fieldbutton" alt="Select date" src="[skinpath]btncalendar.gif" unselectable="on" /></ektdesignns_calendar></p>
My knowledge on validation is limited, but it looks like it's parsing the date as an integer. Is it possible to add a day (+1) to the current date so that it interprets any day as valid as long as it's not in the future?
I guess this is a HTML form as opposed to a Smart form?
If so, have you checked the validation settings on the calendar field? If you edit the form, right-click on the field and choose Field Properties you will get the properties window. Go to the Validation tab and check the setting in the Validation drop down.
There are options for ensuring the date is in the past or the future. Perhaps one of these options has been set?
I am building a form using Parsley.js, but the size command does not work:
<input type="text" size="2" id="month" value=""
data-parsley-type="digits"
data-parsley-length="[2, 2]"
data-parsley-error-message="Expiration Month is Required"
data-parsley-required />
Can anyone suggest an other way of doing this, or is it a bug..
The size attribute you refers to is perfectly working. It affects the input width (the box, not its content). Try putting 10 or 20 instead, and you'll see the box size changing accordingly.
Maybe you are referring to maxlength="2" attribute, that prevent user to enter more than 2 characters in the input box? (That is working too with Parsley)
Best
I need to determine if a set of dates contain two different weeks.
For example:
When returning a set of records from a database that contain a date, there needs to be something to distinguish between the different weeks.
<cfloop query="datesExample">
<cfif DateDiff("d",DateFormat(lastDate),DateFormat(OriginalDate)) GTE 7>
<hr />
</cfif>
<p>#OrginalDate#</p>
<cfset lastDate = DateFormat(OrginalDate) />
</cfloop>
To me, this seems like all the logic I'd need to add to determine if there is a new week.
Although, I'm not getting any results from this.
Anyone have an ideas?
Update:
This is my actual if statement:
<cfif DayofWeek(lastShiftDate) NEQ DayOfWeek(Time_In) AND DateDiff("d",lastShiftDate, Time_In) GTE 7>
I would QueryAddColumn to add an additional column onto the end of your query, then loop through and set the start of the week for each record in the query. Something like this:
<cfset datesExample = QueryNew("lastshiftdate", "date") />
<cfset QueryAddRow(datesExample) />
<cfset QuerySetCell(datesExample, "lastshiftdate", "2009-01-15") />
<cfset QueryAddRow(datesExample) />
<cfset QuerySetCell(datesExample, "lastshiftdate", "2009-01-20") />
<cfset QueryAddColumn(datesExample, "StartofWeek", "time", ArrayNew(1)) />
<cfloop query="datesExample">
<cfset QuerySetCell(datesExample, "StartofWeek", DateAdd("d", -(DayOfWeek(lastshiftdate) - 1), lastshiftdate), CurrentRow) />
</cfloop>
<cfdump var="#datesExample#">
Then when you use the cfoutput, you can just group by the StartofWeek column without doing all of the goofy conditional logic.
Dan
when the dayofweek of dateA is different than dayofweek of dateB , and their DateDiff is larger than 7?
Then dateA and dateB are in different week?
The code you presented has several syntax errors. If you copied it from your source, you might try turning off whatever error trapping is keeping you from seeing the errors.
First, to address syntax:
Your cfif is not closed. DateFormat() takes two arguments -- the date object and the date mask. If this is not in a cfoutput block, you'll just display the literal #OrginalDate#.
To address the logic:
I'm assuming OriginalDate is a field in the query return.
I'm not sure exactly what you are trying to do. Your code would print a horizontal line instead of the date anytime there was more than 6 days between two records. However, you will never print a horizontal line as long as the dates are closer together. So, if you had ever Mon/Wed/Fri in the database, you would never get an HR, because the datediff would be two or three days, never seven.
There are several approaches to deal with this. If you clarify your purpose, we might be able to help you better. For example, what defines a new week? Sat/Sun at midnight? Since the first date in the query? What are you trying to display?
Check out the Day of Week function
Check out the Week function: From a date/time object, determines the week number within the year.
It was much more simple than what I thought. All I had to do was get the value of the first date. So, <cfif query.RecordCount EQ 1><cfset firstDate = Now() /></cfif> and then do a dateDiff() with the lastShiftDate
Thanks for everyone's help.