UWP Telerik UI How to add convert into RadCartesianChart's Vertical Axis? - data-binding

I had been puzzled for a long time as my RadCartesianChart seems to reject to add a convert above on it's axis.
Here is what I had written:
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:DateTimeContinuousAxis Maximum="{x:BindViewModel.Infos.MaxmumDatetime}"
Minimum="{x:Bind ViewModel.Infos.MinmumDatetime}"
GapLength="0.5"
MajorStep="6"
MajorStepUnit="Hour"
LabelFormat="{}{0,0:HH:mm}"
x:Name="HorizontalAxis"
Title="Datetime of request"/>
</telerik:RadCartesianChart.HorizontalAxis>
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis Title="Request Interval" x:Name="VerticalAxis">
</telerik:LinearAxis>
and data binding part:
<telerik:BarSeries ItemsSource="{x:Bind Path=ViewModel.Infos.Logs,Mode=TwoWay}" PaletteMode="Series">
<telerik:BarSeries.ValueBinding>
<telerik:PropertyNameDataPointBinding PropertyName="requestTime" />
</telerik:BarSeries.ValueBinding>
<telerik:BarSeries.CategoryBinding>
<telerik:PropertyNameDataPointBinding PropertyName="createTime"/>
</telerik:BarSeries.CategoryBinding>
</telerik:BarSeries>
What should I do ??

Related

Drillthrough to underlying text data in icCube?

How to set-up a model in icCube to allow to drill down to the details, when details contain text fields?
The idea is to get a list, with column names containing the text fields (in combination with amount fields). Just like a simple SQL statement would give.
I have tried the following:
a) added a technical dimension that is linked to the rows (via rownumber) and added MIN Aggregation for the text fields. With the idea to use these when a DRILLTHROUGH MDX statement is invoked. The DRILLTHROUGH function works, but does not give the values next to each other for the measures. Result is like:
b) added each unique line a line number and loaded the line number as lowest detail in one of the dimensions. Added attributes for these text and date items for the "drillthrough" columns. Next, added calculated measures to get the property for these attributes. The drillthrough is now effectively a drillby to the lowest details. It works, but this is not nice as it blows up my dimension.
c) tried to use the widget data source SQL, but it is not available for text files, and it does not work for MSAccess files (too slow).
The preferable solution should works in the dashboards and in any XMLA/REST API interface.
Enclosed this example
the schema file
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<schemaFactory revisionNumber="7">
<schemaDefinition name="drilltrhough-text" description="" group="Issues" loadOnStartup="false">
<activateIncrementalLoad>false</activateIncrementalLoad>
<useUnknownMembersInFacts>true</useUnknownMembersInFacts>
<autoCleanUpTableColumns>false</autoCleanUpTableColumns>
<useFactPartitioning>false</useFactPartitioning>
<callGarbageCollector>NONE</callGarbageCollector>
<backup>NONE</backup>
<nonEmptyCachePolicy>NONE</nonEmptyCachePolicy>
<nonEmptyCacheType>REGULAR</nonEmptyCacheType>
<nonEmptyCachePersistency>MEMORY</nonEmptyCachePersistency>
<storagePolicy>DEFAULT</storagePolicy>
<hierarchyUniqueNameStyle>IncludeDimensionName</hierarchyUniqueNameStyle>
<inMemoryDS name="data">
<memoryDataTable tableName="data" rowLimit="-1" id="d9429713-9be8-4c63-9b40-4a20388e7563">
<column name="dimension" tableType="STRING" type="STRING" selected="true" primaryKey="false"/>
<column name="amount" tableType="STRING" type="STRING" selected="true" primaryKey="false"/>
<column name="text" tableType="STRING" type="STRING" selected="true" primaryKey="false"/>
<addRowNumber>false</addRowNumber>
<stringDateConverter></stringDateConverter>
<trimStrings>true</trimStrings>
<columnSeparator>,</columnSeparator>
<commentMarker>#</commentMarker>
<dataAsString>dimension, amount, text
a, 10,some text
b, 20, some more text
c, ,text without an amount</dataAsString>
</memoryDataTable>
</inMemoryDS>
<multiLevelDimension dataTableId="d9429713-9be8-4c63-9b40-4a20388e7563" isTimeDimension="false" isDefaultTimeDimension="false" isIndexingByRange="false" id="86d118f0-71ba-4826-a6ac-343eac96fb05" name="Dimension">
<multiLevelHierarchy hasAllLevel="true" allLevelName="All-Level" allMemberName="All" name="Dimension" isDefault="true">
<level name="Dimension - L" nameUnique="false" nameUniqueInParent="false" keyUnique="false" ignoreNameCollision="false">
<nameCol name="dimension"/>
<orderType>BY_NAME</orderType>
<orderKind>ASC</orderKind>
</level>
</multiLevelHierarchy>
</multiLevelDimension>
<cube id="caa9c520-f953-4c77-9e72-76c8668170f7" name="Cube">
<defaultFacts measureGroupName="Facts" partitioningLevelName="" partitioningType="NONE" newGeneration="true" dataTableId="d9429713-9be8-4c63-9b40-4a20388e7563" aggregateDataSourceFacts="false" unresolvedRowsBehavior="ERROR">
<rowFactAggregationType>ADD_ROW</rowFactAggregationType>
<measure name="Amount" aggregationType="SUM">
<dataColumn name="amount"/>
</measure>
<measure name="Text" aggregationType="MIN">
<dataColumn name="text"/>
</measure>
<links dimensionId="86d118f0-71ba-4826-a6ac-343eac96fb05">
<viewLinks type="LAST_LEVEL">
<toColumns name="dimension"/>
</viewLinks>
</links>
</defaultFacts>
</cube>
</schemaDefinition>
</schemaFactory>
- the mdx
drillthrough
select [Measures].members on 0
, [Dimension].[Dimension].[Dimension - L] on 1
from [cube]
return Name([Dimension])
the result
This is not related to having a measure of type STRING.
You're performing a multi-cell result drillthrough (which is an extension of standard MDX in icCube). In that case, the result is "organized" per result cell meaning each [Measures] being in its own category (you can add another Amount measure and you'll see the same behavior).
Instead you should perform a single cell drillthrough:
drillthrough
select [Dimension].[Dimension].[Dimension -L].[a] on 0
from [cube]
And the result should look like:
You can see the [Measures].[Info] being on the same row (as all the other measures).
Hope that helps.

RangeValidator doesnt work as expected using specific date

When I try to submit a specific date "20-10-2013" (international format: 2013-10-20"), rangevalidator throws the error message for invalid date
<asp:TextBox ID="txtDataInicial" runat="server" Width="55px"></asp:TextBox>
<asp:RangeValidator ID="rgvDtInicial" runat="server" ControlToValidate="txtDataInicial"
Display="Static" MinimumValue="01/01/1800" MaximumValue="31/12/9999" Type="Date"
ErrorMessage="A data inicial, deve ter o seguinte formato: DD/MM/AAAA"
ValidationGroup="Consultar"></asp:RangeValidator>
<asp:Button ID="btnConsultar" runat="server" Style="width: 150px;" Text="Consultar"
OnClick="btnConsultar_Click" ValidationGroup="Consultar" />
It works for dates like , "19-10-2013", "21-10-2013", "20-10-2014", "20-10-2012".
It just happens when I submit this date!
Does anyone know why?
Dates are culture-depended. Specify your culture declaratively in web.config or in a Page directive, or programatically.
Check this out: http://msdn.microsoft.com/en-us/library/bz9tc508(v=vs.100).aspx
Rangevalidator control front end code
This is the culprit of the error. Make sure the cultureinvariantvalues is set to false.
Ensure assigning the correct minimum & maximum date range at code behind.
This is to standardise our date comparison to culture="en-GB" which use "dd/mm/yyyy" independent of server localization setting. You may use the "en-US" and the format will be "mm-dd-yyyy".
http://chinteongtan.blogspot.com/2014_04_01_archive.html

Custom error in validation is not show in h:message

I want to show a custom message when user insert a wrong input for a Double value but when i test my application i always see the default error message.
That's my custom messages.properties:
`javax.faces.convert.DoubleConverter.CONVERSION=My Conversion Error(Double)
javax.faces.convert.DoubleConverter.CONVERSION_detail=My Conversion Error(Double)
javax.faces.component.UIInput.CONVERSION=My Conversion Error
javax.faces.component.UIInput.CONVERSION_detail=My Conversion Error(Double)
javax.faces.validator.NOT_IN_RANGE=My Validation Error
javax.faces.validator.NOT_IN_RANGE_detail=My Validation Error
javax.faces.validator.DoubleRangeValidator.LIMIT=Validation Limit Double
javax.faces.validator.DoubleRangeValidator.LIMIT_detail=Validation Limit Double
javax.faces.validator.DoubleRangeValidator.TYPE=Error Type Double
javax.faces.validator.DoubleRangeValidator.TYPE_detail = Error Type Double
javax.faces.component.UIInput.REQUIRED=Requested!!
`
And here my faces.config
`<application>
<message-bundle>it.exaple.messages.MyMsg</message-bundle>
</application>`
And here my page:
`<td>
<h:inputText id="Value" value="#{user.value}" required="true">
<f:validateDoubleRange minimum="0.0" maximum="200.0"/></h:inputText>
<h:message for="username" showDetail="true" showSummary="true" style="color:red"/>
</td>`
It's really strange because when i test my application with an empty value i can read my customized message, but when i try to insert a string i see the default error message!! Same thing happen when i put a to high or too low value!
Anyone can help me? Thanks!
I hope you must override these default message to validate range of double. And I hope you have defined user.value as double in your managed bean.
javax.faces.validator.DoubleRangeValidator.MAXIMUM
javax.faces.validator.DoubleRangeValidator.MINIMUM
javax.faces.validator.DoubleRangeValidator.NOT_IN_RANGE

Can I make a Flex line chart not purge values past max/min values

I want to use min/max values not to restrict what values exist but what values are shown.
I am having issues with both X and Y axes and not sure if flex is capable of doing what I want...
on the Y axis
I am showing different days, and I want the scale to be the same on all the charts, but there is no absolute maximum value. I set the maximum to 18 which works great until a point with the value of 24 shows up. And instead of the line going off the chart or showing as high as it goes, it is simply removed from the dataset. Is there a way to keep it in the data set and still show it somehow? Like charts where arrows indicate out of range values and still allow you to access them?
on the X axis
I have a line chart that is plotting a changing value (captured at irregular intervals) over the course of a day. As of now because I have the DateTimeAxis restricted to a 24 hour period (how I want it) there is dead space before the first and after the last data point.
I'd like the line to continue if there is a following or preceding data point available. I am providing the following and preceding data points to the chart. But the chart is just ignoring datapoints outside of the range instead of continuing the line off the edge. Is there any way I can render the whole series but only show a specific 24 hours of it?
private function loadDayComplete():void
{
minChartDate = new Date;
minChartDate.fullYear = currentDate.fullYear;
minChartDate.month = currentDate.month;
minChartDate.date = currentDate.date;
minChartDate.hours = offset;
minChartDate.minutes=0;
minChartDate.seconds=0;
minChartDate.milliseconds=0;
maxChartDate = new Date;
maxChartDate.time = minChartDate.time + 1000*60*60*24;
glucoseSeries.dataProvider = bgResults;
bgTimeAxis.minimum = minChartDate;
bgTimeAxis.maximum = maxChartDate;
<mx:LineChart showDataTips="true" id="GlucoseChart">
<mx:horizontalAxis>
<mx:DateTimeAxis id="bgTimeAxis" dataUnits="minutes" parseFunction="parseDateString" displayLocalTime="true" />
</mx:horizontalAxis>
<mx:series>
<mx:LineSeries id="glucoseSeries" showDataEffect="{dataIn}" radius="10" width="100" form="curve" displayName="BG" yField="Value" xField="DateTime">
<mx:itemRenderer>
<fx:Component>
<skins:MealBlobItemRenderer/>
</fx:Component>
</mx:itemRenderer>
</mx:LineSeries>
</mx:series>
</mx:LineChart>

Flex Charts: Can you use a minimum/maximum point from an IAxis for Cartesian Data Canvas to draw the entire width of the chart?

I have a chart with a DateTime axis as my horizontal and a Linear Axis for my vertical inside a Adobe Flex Line Chart. I want to use a Cartesian Data Canvas as a background element and draw custom set of background graphics mostly rectangles. When I have more than a single data point, the graphics work perfectly since they are supposed to span the width of the entire chart.
When I have only a single data point, however, I can't seem to get the rectangles to draw. Since I want my rectangles to span the entire width of the chart, I was thinking that I could get the x-coordinates from my axis, but this isn't working.
var canvasWidth:Number = chtCanvas.width;
var canvasHeight:Number = chtCanvas.height;
var minPt:Array;
var maxPt:Array;
var minPtDate:Date;
var maxPtDate:Date;
var minPtComplete:Point;
var maxPtComplete:Point;
// This works fine when there is more than 1 data point
minPt = chtCanvas.localToData(new Point(0, 0));
maxPt = chtCanvas.localToData(new Point(canvasWidth,canvasHeight));
//This does return a date object, but wont draw below
minPtDate = axisDate.minimum;
maxPtDate = axisDate.maximum;
//This returns NaN for the x
minPtComplete = chtCanvas.dataToLocal(minPtDate, axisSalary.minimum);
maxPtComplete = chtCanvas.dataToLocal(maxPtDate, axisSalary.maximum);
// Also tried this. Also returns NaN for the x value
//minPtComplete = chtCanvas.dataToLocal(axisDate.minimum, axisSalary.minumum);
//maxPtComplete = chtCanvas.dataToLocal(axisDate.maximum, axisSalary.maximum);
My actual drawing method is as follows:
// Tried this, works with points >2, does not draw with single data point
chtCanvas.drawRect(minPt[0], detail[i].MaxValue, maxPt[0], detail[i].MinValue);
//tried this, no effect with single point
//chtCanvas.drawRect(minPtDate, detail[i].MaxValue, maxPtDate, detail[i].MinValue);
// Tried this, no effect with single point
//chtCanvas.drawRect(minPtDate, minPt[1], maxPtDate, detail[i].MinValue);
// Tried this also
//chtCanvas.drawRect(minPtComplete.x, detail[i].MaxValue, maxPtComplete.x, detail[i].MinValue);
In this example, detail is an array collection of salary values and Im using the data value in the array to determine the vertical bounds of my rectangles.
I need to draw the rectangles the entire width of the chart (even when there is only a single data point). Thanks
Thanks to Heikki for his help. The following code works to use the axis values to draw on your Cartesian Data Canvas:
chtCanvas.drawRect(axisDate.minimum as Date, axisSalary.maximum, axisDate.maximum as Date, axisSalary.minimum);
Casting the values as Date really helped. The rest of the code used above is unecessary.
One thing to note, I was using a DateFormatter to format the date values from my data. What I didn't consider was that when using a DateTimeAxis, Flex will automatically add in extra dates to display on the axis. In my case, I was using a custom parse function to create MY points, but wasnt considering the points Flex was creating and also passing to my parse function (Therefore, they were not getting parsed correctly). Once I corrected this, the values laid out correctly in the case of multiple data points. I'm still having a bit of an issue with single data points and them not filling the chart entirely, but they are now drawing.
UPDATE:
Although there are signs of life, the minimum and maximum are still not drawing the entire width of the chart in some cases depending on the dataUnits and labelUnits combination.
UPDATE #2: SOLVED
Ok, so the axis does work as minimum/maximum values for the Cartesian Data Canvas but there is something important to remember. For a single point (and probably for multiple points as well, I just couldnt visually see the difference), when using a custom DateTimeAxis parse function such as what was in the Adobe Flex ASDoc tutorials:
private function axisDateParseFunction(item:String):Date
{
var inputDate:String = item;
inputDate = fmtDate.format(inputDate);
var newDate:Date = new Date();
if(inputDate)
{
var a:Array = inputDate.split('/');
newDate.fullYear = a[2];
newDate.month = a[0] - 1;
newDate.date = a[1];
newDate.hours = 0;
newDate.hoursUTC = 0;
newDate.minutes = 0;
newDate.minutesUTC = 0;
newDate.seconds = 0;
newDate.secondsUTC = 0;
newDate.milliseconds = 0;
newDate.millisecondsUTC = 0;
}
return newDate;
}
You MUST remember to set the UTC values as shown above also. Since the DateTimeAxis uses date AND time, when you create new Date objects, their time values also get set to the local system time. Remember to set those values to zero also or you will get points that dont exactly line up with your axis labels.

Resources