Disable Telerik Chart Legend by default - asp.net

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>

Related

Removing parent nodes from xml file in r

I have xml output below. I am trying to remove parents using XML or xml2 library from R. I found a similar post here but those functions somehow gave me an error. I am trying to remove those parents until analysisdata parent. That is what I am going to parse.
<assessment>
<itembank />
<instrument id="797393 ">
<form id="Math G3">
<formitem id="8243" position="0" />
</form>
</instrument>
<admin id="797393 " instrument="797393 ">
<genatt name="adminperiod" value="SP19" />
<responseanalyses>
<responsebankref id="3M" />
<analysisdefs>
<analysisoption name="mark" value="no" />
<analysisoption name="notreached" value="ASNOTPRESENTED" />
<statentity type="item" id="8243" varname="I_8243">
<genatt name="type" value="CR" />
<genatt name="codestart" value="0" />
<genatt name="validcodes" value="2" />
<genatt name="omitcode" value="9" />
<genatt name="notpresentedcode" value="8" />
<statentity code="0.000000" id="0.000000" type="itemscorept" />
<statentity code="1.000000" id="1.000000" type="itemscorept" />
<statentity code="9" id="omit" type="itemscorept" />
</statentity>
<genatt name="type" value="CR" />
<genatt name="codestart" value="0" />
<genatt name="validcodes" value="2" />
<genatt name="omitcode" value="9" />
<genatt name="notpresentedcode" value="8" />
<statentity code="0.000000" id="0.000000" type="itemscorept" />
<statentity code="1.000000" id="1.000000" type="itemscorept" />
<statentity code="9" id="omit" type="itemscorept" />
</statentity>
<statentity id="DIFGROUP_TTS" varname="DIFGROUP_TTS" type="popgroup" description="DIFGROUP_TTS">
<statentity code="0.000000" id="0.000000" description="0.000000" samplesize="40501" type="popsubgroup" />
<statentity code="1.000000" id="1.000000" description="1.000000" samplesize="5532" type="popsubgroup" />
</statentity>
</analysisdefs>
<genatt name="xmloutputfile" value="J:\out.xml" />
<analysis creator="ST" description="" level="form" type="classical">
<analysisdata formid="Math G3">
<statentityref id="8243" type="item">
<statval type="OmitCount" value="0.000000" />
<statval type="NotReachedCount" value="43.000000" />
<statval type="PolyserialCorrelation" value="0.644181" />
<statval type="AdjustedPolyserial" value="0.644181" />
<statval type="AverageScore" value="0.223074" se="0.011957" />
<statval type="NCount" value="2609.000000" />
<statval type="StdevItemScore" value="0.416308" />
</statentityref>
</statentityref>
</statentityref>
</analysisdata>
</analysis>
</responseanalyses>
<responsebank findin="J:\outAM.am" sourcetype="AM" id="3M" />
</admin>
</assessment>
I tried
library(xml2)
library(XML)
newdoc <- xpathApply(doc, "/assessment/admin/responseanalyses") I get this error after running this: Error in UseMethod("xpathApply") :
no applicable method for 'xpathApply' applied to an object of class "c('xml_document', 'xml_node')". THis solution was suggested here.
After removing those parent nodes, I would like to have analysisdata node only after removing the assessment/admin/responseanalyses parent node. Desired out is like this below:
<analysisdata formid="Math G3">
<statentityref id="8243" type="item">
<statval type="OmitCount" value="0.000000" />
<statval type="NotReachedCount" value="43.000000" />
<statval type="PolyserialCorrelation" value="0.644181" />
<statval type="AdjustedPolyserial" value="0.644181" />
<statval type="AverageScore" value="0.223074" se="0.011957" />
<statval type="NCount" value="2609.000000" />
<statval type="StdevItemScore" value="0.416308" />
</statentityref>
</statentityref>
</statentityref>
</analysisdata>
Any thoughts?
Thanks!
You could use html_node from rvest library
rvest::html_node(doc, 'analysisdata')

telerik RAD HTMLChart Label display NaN (not a number)

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

displayTag pagenation issue -next ,last ,CSV and EXCEL XMLis not working

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">

Insert Image into a Column Series Telerik

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

WHy is awesome_print gem showing <br /> in rspec output

I'm getting this output from ap, in my rspec test
"line1"<br />
"line2"<br />
"city"<br />
"state"<br />
"zip"<br />
"country"<br />
It is not because of the :html option, because when that's on it looks like:
<pre><kbd style="color:brown">"line1"</kbd></pre><br />
<pre><kbd style="color:brown">"line2"</kbd></pre><br />
<pre><kbd style="color:brown">"city"</kbd></pre><br />
<pre><kbd style="color:brown">"state"</kbd></pre><br />
<pre><kbd style="color:brown">"zip"</kbd></pre><br />
<pre><kbd style="color:brown">"country"</kbd></pre><br />

Resources