I have a chart that is getting data from a SQL database in codebehind. Everything displays correctly and the series have the correct number on hover.
It is a stacked bar with the Show totals work a round found on this site.
http://www.telerik.com/support/kb/aspnet-ajax/chart-%28html5%29/details/displaying-grand-total-in-stacked-series-labels-and-pie-series-legend
I know the data coming from SQL is a number because I'm casting it to decimal.
The gTotal shows: "TL bbl: NaN"
If I just do TL bbls: #=dataItem.TotalRed# it shows undefined
Any Ideas?
code behind:
Dim daFMChart As New SqlDataAdapter(SQLFM, Conn)
daFMChart.Fill(DTFMChart)
Me.ColumnChart.DataSource = DTFMChart
Me.ColumnChart.DataBind()
The SQL data is this
+-------------------------------------------------+
| DateTime TotalRed TotalWhite gTotal |
+-------------------------------------------------+
| 2016-03-25 20000 3 0.0001 |
| 2016-03-24 30000 2601 0.0001 |
| 2016-03-23 50000 45626 0.0001 |
| 2016-03-22 10000 55568 0.0001 |
| 2016-03-21 30000 54098 0.0001 |
| 2016-03-20 10000 51351 0.0001 |
| 2016-03-19 20000 21973 0.0001 |
+-------------------------------------------------+
<ChartTitle Text="Daily Volume Total Per Meter">
<Appearance Align="Right" Position="Top">
<TextStyle Color="#999999" />
</Appearance>
</ChartTitle>
<Legend>
<Appearance Position="Right" Visible="true">
<TextStyle Color="#999999" />
</Appearance>
</Legend>
<PlotArea>
<Series>
<telerik:ColumnSeries Name="FM Red" DataFieldY="TotalRed" Stacked="true">
<LabelsAppearance Visible="false"></LabelsAppearance>
<Appearance>
<FillStyle BackgroundColor="#ff1a1a"></FillStyle>
</Appearance>
</telerik:ColumnSeries>
<telerik:ColumnSeries Name="FM White" DataFieldY="TotalWhite">
<LabelsAppearance Visible="false"></LabelsAppearance>
<Appearance>
<FillStyle BackgroundColor="#bfbfbf"></FillStyle>
</Appearance>
</telerik:ColumnSeries>
<telerik:ColumnSeries DataFieldY="gTotal" Stacked="true">
<Appearance FillStyle-BackgroundColor="#DDD9C3"></Appearance>
<LabelsAppearance Position="OutsideEnd">
<TextStyle Color="#999999" />
<TextStyle Margin="0" />
<ClientTemplate>
TL bbls: #=dataItem.TotalRed + dataItem.TotalWhite#
</ClientTemplate>
</LabelsAppearance>
<TooltipsAppearance Visible="false">
</TooltipsAppearance>
</telerik:ColumnSeries>
</Series>
<XAxis DataLabelsField="DateTime"></XAxis>
<XAxis>
<MajorGridLines Visible="false" />
<MinorGridLines Visible="false" />
<LabelsAppearance Step="1">
<TextStyle Color="#999999" />
</LabelsAppearance>
</XAxis>
<YAxis>
<MajorGridLines Visible="true" Color="#555555" />
<MinorGridLines Visible="false" />
<LabelsAppearance Step="1">
<TextStyle Color="#999999" />
</LabelsAppearance>
</YAxis>
</PlotArea>
<ChartTitle Text=""></ChartTitle>
Guess what..... Its a Bug.
Does not work with a Date column for the X Axis.
What a pain in the balls that was to figure out.
Had to use 3|24 as a string.. Could not use 3/24
Related
why cascadeSelect desables buttons ? if i use selectOneMenu it works well.
in this example i removed others columns to simplify:
<p:accordionPanel id="infoMF">
<p:tab id="mainInfo" title = "Equipment Information">
<p:dataTable id="mainInfoTab" var="ecnEquipment" value="#{main.equipment.templateEqpItems}" scrollable="true" scrollHeight="250" style="font-size:10px">
<p:column headerText="ConstructType" style="text-align:center;width:0.2rem;font-size:10px;">
<p:cascadeSelect styleClass="custom-filter" value="#{ecnEquipment.constructType}" >
<f:selectItems value="#{list.listConstructType}" />
<p:ajax event="itemSelect" process="#this"/>
</p:cascadeSelect>
</p:column>
</p:dataTable>
<p:toolbar>
<p:toolbarGroup >
<p:selectOneMenu
label="Choose an equipment for deleting"
value="#{main.eqpToRemove}"
immediate="true">
<f:selectItems value="#{main.listEqpExisting}" />
</p:selectOneMenu>
<p:commandButton id="delBtn" icon="pi pi-trash"
action="#{main.deleteEquipment}" process="#this mainInfo"
update="mainInfo" styleClass="ui-button-danger"/>
<p:tooltip value="Remove the selected equipment" for="delBtn" />
<p:tooltip value="add an equipment" for="addBtn" />
<p:tooltip value="select an equipment to remove" for="listToRemoveFrom" />
<p:tooltip value="select a type for the equipment to add" for="listTypeEquipment" />
</p:toolbarGroup>
</p:toolbar>
</p:tab>
</p:accordionPanel>
there is no error in consol. i'am using java 8
How can I make one of the legend of a RadHtmlChart chart display unchecked by default when loading the chart.
Current Chart: current chart
Desired Chart: desired chart
Current telerik asp:
<telerik:RadHtmlChart runat="server" Skin="Bootstrap" ID="RhcIndicadores" Transitions="true">
<Legend>
<Appearance Position="Bottom"></Appearance>
</Legend>
<PlotArea>
<Series>
<telerik:ColumnSeries DataFieldY="Cantidad" Name="Cantidad">
<LabelsAppearance Position="InsideBase" DataFormatString="{0:0}">
<TextStyle Color="White" />
</LabelsAppearance>
<TooltipsAppearance>
<ClientTemplate>Cantidad: #=dataItem.Cantidad# requerimientos.</br>Participación: #= kendo.format(\'{0:N}\', dataItem.Participacion)#%.</br>Rango: #=dataItem.Rango#.</ClientTemplate>
</TooltipsAppearance>
</telerik:ColumnSeries>
<telerik:LineSeries DataFieldY="Participacion" Name="Participación" AxisName="AdditionalAxis">
<Appearance>
<FillStyle BackgroundColor="#ACB72F" />
</Appearance>
<LabelsAppearance DataFormatString="{0:N}%">
<TextStyle Color="#ACB72F" />
</LabelsAppearance>
<TooltipsAppearance DataFormatString="{0:N}%"></TooltipsAppearance>
</telerik:LineSeries>
<telerik:LineSeries DataFieldY="ParetoAcumulado" Name="Pareto Acumulado" AxisName="AdditionalAxisPareto">
<Appearance>
<FillStyle BackgroundColor="#5BC0DE" />
</Appearance>
<LabelsAppearance DataFormatString="{0:N}%" Position="Above">
<TextStyle Color="#5BC0DE" Bold="true" />
</LabelsAppearance>
<TooltipsAppearance DataFormatString="{0:N}%"></TooltipsAppearance>
</telerik:LineSeries>
</Series>
<XAxis DataLabelsField="Rango">
<LabelsAppearance RotationAngle="45"></LabelsAppearance>
<AxisCrossingPoints>
<telerik:AxisCrossingPoint Value="0" />
<telerik:AxisCrossingPoint Value="11" />
</AxisCrossingPoints>
<MajorGridLines Visible="false" />
<MinorGridLines Visible="false" />
</XAxis>
<YAxis Color="#337AB7">
<MajorGridLines Visible="false" />
<MinorGridLines Visible="false" />
</YAxis>
<AdditionalYAxes>
<telerik:AxisY Name="AdditionalAxis" Color="#ACB72F">
<LabelsAppearance DataFormatString="{0:N}%"></LabelsAppearance>
</telerik:AxisY>
<telerik:AxisY Name="AdditionalAxisPareto" Color="#5BC0DE">
<LabelsAppearance DataFormatString="{0:N}%"></LabelsAppearance>
</telerik:AxisY>
</AdditionalYAxes>
</PlotArea>
</telerik:RadHtmlChart>
I myself found the answer, in the desired series it should be indicated Visible="false" and VisibleInLegend="true":
<telerik:LineSeries DataFieldY="ParetoAcumulado" Name="Pareto Acumulado"
Visible="false" VisibleInLegend="true" AxisName="AdditionalAxisPareto">
<Appearance>
<FillStyle BackgroundColor="#5BC0DE" />
</Appearance>
<LabelsAppearance DataFormatString="{0:N}%" Position="Above">
<TextStyle Color="#5BC0DE" Bold="true" />
</LabelsAppearance>
<TooltipsAppearance DataFormatString="{0:N}%"></TooltipsAppearance>
</telerik:LineSeries>
NEXT ,LAST,CSV,XML
i am not able to use the displaytag property like next,last,CSV ,XML etc
The code goes like this as show below
<link href="resources/displaytag.css" rel="stylesheet" type="text/css" media="all" />
<link href="resources/alternative.css" rel="stylesheet" type="text/css" media="all" />
<body>
<form:form action="date" method="get" >
<display:table name="billingLogReportPojoList" id="billingLogTable"
export="true" class="its" pagesize="10" >
<display:setProperty name="basic.empty.showtable" value="true"></display:setProperty>
<display:setProperty name="export.pdf.decorator" value="org.displaytag.sample.decorators.ItextTotalWrapper" />
<display:setProperty name="export.pdf.filename" value="billingLogReport.pdf" />
<display:setProperty name="export.rtf.decorator" value="org.displaytag.sample.decorators.ItextTotalWrapper" />
<display:setProperty name="export.rtf.filename" value="billingLogReport.rtf" />
<display:setProperty name="export.excel.decorator" value="org.displaytag.sample.decorators.HssfTotalWrapper" />
<display:setProperty name="export.excel.filename" value="billingLogReport.xls" />
<display:setProperty name="export.csv" value="true" />
<display:setProperty name="export.xml" value="true" />
<display:column title="ID" property="pnrId" />
<display:column title="Request Date Time" property="requestDateTime" format="{0,date,dd-MM-yyyy}"/>
<display:column title="Status" property="status" />
<display:column title="Trace No" property="traceNo" />
<display:column title="Reference No" property="referenceNo" />
<display:column title="PNR No" property="pnrNo" />
<display:column title="PNR Status" property="pnrStatus" />
<display:column title="Amount" property="amount" />
<display:column title="Ticket No." property="ticketNo"/>
<display:column title="Ticket Value" property="ticketValue" />
<display:column title="Passenger Type" property="passengerType" />
<display:column title="Given Name" property="givenName" />
<display:column title="Surname" property="surname" />
<display:column title="Mobile No." property="mobileNo" />
<display:column title="Email" property="email"/>
<display:column title="Taxes" property="taxes" style="white-space: nowrap;"/>
</display:table>
</div>
</form:form>
</div>
</body>
</html>
When i am clicking on like CSV it is not generating the file and giving error like 404
you have to set requestURI parameter in <display:table />!
if you don't set it properly when you click on the link, the page will be initialized without any arguments!
here is a sample of correct code:
<display:table name="appUserAttendanceList" id="assetUserAttendance" htmlId="thetable"
class="tableBorder" defaultorder="ascending" sort="list"
pagesize="10" excludedParams="method" export="true"
requestURI="/assetUserManagement.do?method=setAttendanceFromClient">
I need to add an image in a specific Column chart, but I have no idea how can I insert the image, any idea, tutorial ?
I am using the RadHtmlChart
this is my code:
<telerik:RadHtmlChart ID="Chart" runat="server" Width="680" Height="500">
<PlotArea>
<XAxis>
<LabelsAppearance>
<TextStyle Color="white" FontFamily="Arial" FontSize="13" />
</LabelsAppearance>
</XAxis>
<YAxis MinValue="0" >
<LabelsAppearance DataFormatString="${0:0,0}">
<TextStyle Color="white" FontFamily="Arial" FontSize="12" />
</LabelsAppearance>
</YAxis>
<Series>
<telerik:ColumnSeries Name="Garantías Vigentes" Stacked="true">
<LabelsAppearance Position="Center" DataFormatString="${0:0,0}">
<TextStyle Color="Black" FontFamily="Arial" Bold="True" FontSize="18" />
</LabelsAppearance>
<Appearance>
<FillStyle BackgroundColor="#87cb50"></FillStyle>
</Appearance>
<SeriesItems>
</SeriesItems>
</telerik:ColumnSeries>
</Series>
<Series>
<telerik:ColumnSeries Name="Saldo Vigente" Stacked="true">
<LabelsAppearance Position="Center" DataFormatString="${0:0,0}">
<TextStyle Color="Black" FontFamily="Arial" Bold="True" FontSize="18" />
</LabelsAppearance>
<Appearance>
<FillStyle BackgroundColor="#8DB4E2"></FillStyle>
</Appearance>
<SeriesItems>
<telerik:CategorySeriesItem Y="0"></telerik:CategorySeriesItem>
</SeriesItems>
</telerik:ColumnSeries>
<telerik:ColumnSeries Name="" > //In this Column I need to insert the image
<LabelsAppearance Position="Center" DataFormatString="${0:0,0}">
<TextStyle Color="Black" FontFamily="Arial" Bold="True" FontSize="0" />
</LabelsAppearance>
<Appearance>
</Appearance>
<SeriesItems>
<telerik:CategorySeriesItem Y="0"></telerik:CategorySeriesItem>
</SeriesItems>
</telerik:ColumnSeries>
</Series>
</PlotArea>
<Legend>
<Appearance Position="Bottom"><TextStyle Color="white" FontFamily="Arial" FontSize="20" Bold="True"/></Appearance>
</Legend>
</telerik:RadHtmlChart>
I found in the forums Telerik but I can not find anything similar.
thanks for yours comments
I don't see where you have attempted to add an image, but this would be possible only inside a series tooltip, because this is the only place in the chart that renders HTML, the rest is SVG/VML.
Take a look at these articles to see how to add HTML to your tooltips and bind it to database data, if needed (e.g., for the src attribute):
http://www.telerik.com/help/aspnet-ajax/htmlchart-client-templates-for-tooltips-and-labels.html
http://www.telerik.com/help/aspnet-ajax/htmlchart-client-templates-for-tooltips-and-labels-execute-javascript-and-display-html.html
I hope to find an answer on customizing Datagrid from WPF toolkit 2010. I'd like to add a TITLE area to be above DataGridColumnHeaderPresenter of the datagrid. The problem is that I want it to be as a user control or data template where I can populate the title from XML. I want to have unique titles for multiple datagrids on one page getting data from one XML. I populate few datagrids in the same window. What will be the best solution to add customizable Tile area for a content populated from XML and bounded to each datagrid to avoid dublication?
Thank you in advance. I generate datagrid with columns this way:
<Custom:DataGrid Grid.Column="0" Grid.Row="1" x:Name="ServerList" ItemsSource="{Binding Source={StaticResource PagesData}, XPath=ListTiles/Tile1}">
<Custom:DataGrid.Columns>
<Custom:DataGridTextColumn Header="Name" Binding="{Binding XPath=#Name}" />
<Custom:DataGridTextColumn Header="Status" Binding="{Binding XPath=#Status}" />
<Custom:DataGridTextColumn Header="Events" Binding="{Binding XPath=#Events}" />
<Custom:DataGridTextColumn Header="Services" Binding="{Binding XPath=#Services}" />
</Custom:DataGrid.Columns>
<Custom:DataGrid x:Name="Events" Grid.Column="0" Grid.Row="2" ItemsSource="{Binding Source={StaticResource PagesData}, XPath=ListTiles/Tile2}" >
<Custom:DataGrid.Columns>
<Custom:DataGridTextColumn Header="Name" Binding="{Binding XPath=#Name}" />
<Custom:DataGridTextColumn Header="Level" Binding="{Binding XPath=#Level}" />
<Custom:DataGridTextColumn Header="Source" Binding="{Binding XPath=#Source}" />
<Custom:DataGridTextColumn Header="In last 24h" Binding="{Binding XPath=#TimeSpan}" />
</Custom:DataGrid.Columns>
<Custom:DataGrid x:Name="Services" Grid.Column="2" Grid.Row="2" ItemsSource="{Binding Source={StaticResource PagesData}, XPath=ListTiles/Tile3}">
<Custom:DataGrid.Columns>
<Custom:DataGridTextColumn Header="Name" Binding="{Binding XPath=#Name}" />
<Custom:DataGridTextColumn Header="Status" Binding="{Binding XPath=#Status}" />
<Custom:DataGridTextColumn Header="Start" Binding="{Binding XPath=#Start}" />
</Custom:DataGrid.Columns>
XML:
<?xml version="1.0" encoding="utf-8"?>
<ListTiles xmlns="">
<Tile1>
<Header Title="ROLES & GROUPS" />
<Server Name="Kim" Status="ready" Events="1" Services="1" />
<Server Name="Sherri" Status="past" Events="2" Services="1"/>
<Server Name="Mike" Status="future" Events="3" Services="1" />
</Tile1>
<Tile2>
<Header Title="EVENTS" />
<Server Name="Young" Level="average" Source="home" TimeSpan="5" />
<Server Name="Sarah" Level="Critical" Source="work" TimeSpan="6" />
<Server Name="Susan" Level="normal" Source="friend" TimeSpan="2" />
</Tile2>
<Tile3>
<Header Title="SERVICES" />
<Server Name="Josh" DisplayName="FF" Status="Running" Start="Auto" />
<Server Name="Amy" DisplayName="DD" Status="Rest" Start="Auto" />
<Server Name="Bill" DisplayName="AS" Status="Work" Start="Auto" />
</Tile3>
</ListTiles>