What I need to do is to display the folder and sub folders on tree view. This should not include files inside or outside the folder. What I accomplish now is I have display the directory in tree view. What I need now is to remove the files.
Here is my code:
<asp:TextBox ID="txtFile" runat="server"></asp:TextBox> <asp:Button ID="btnBrowse"
runat="server" Text="Browse" OnClick="btnBrowse_Click" />
<br />
<br />
<asp:TreeView ID="TreeView1" runat="server" Height="326px" ImageSet="XPFileExplorer"
NodeIndent="15" Width="292px">
<ParentNodeStyle Font-Bold="False" />
<HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
<SelectedNodeStyle BackColor="#B5B5B5" Font-Underline="False" HorizontalPadding="0px"
VerticalPadding="0px" />
<NodeStyle Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black" HorizontalPadding="2px"
NodeSpacing="0px" VerticalPadding="2px" />
</asp:TreeView>
Code behind:
TreeNode onjParent = new TreeNode("D:\\", "D:\\");
onjParent.PopulateOnDemand = true;
TreeView1.Nodes.Add(onjParent);
TreeView1.CollapseAll();
I just want to remove the leaf. And display only the folder and sub folder.
Finding it hard to increase the space between the bars. Unable to find any solution that works in my case. Though the chart type is column, it shows up as a stacked column.
<asp:Chart ID="bcOperators" runat="server" Width="500" Height="300">
<Series>
<asp:Series Name="Operator" ChartType="Column" IsValueShownAsLabel="true" />
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
<AxisX Interval="1" Title="Operators"></AxisX>
<AxisY Title="Count"></AxisY>
</asp:ChartArea>
</ChartAreas>
This did not work
bcOperators.Series["y"].BorderWidth = 1;
bcOperators.Series["y"].BorderColor = Color.White;
Try This :
<Series>
<asp:Series Name="Operator" ChartType="Column" IsValueShownAsLabel="true" CustomProperties="PointWidth=.6" />
</Series>
I'm trying to get Microsoft Chart controls working on an ASP.NET project. Microsoft have helpfully replaced the samples file with a new version which doesn't include an asp.net code, so I can't look there for help.
On a blank asp.net 4 forms app, if I add the following (or just drag 'Chart' from the toolbar)
<asp:Chart ID="Chart1" runat="server">
<Series>
<asp:Series Name="Series1"></asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1"></asp:ChartArea>
</ChartAreas>
</asp:Chart>
I get the following error
Server Error in '/' Application.
Stack empty.
Any ideas?
UPDATE:
For those asking, I did try adding data. The following code has the same result
<asp:Chart ID="chtNBAChampionships" runat="server">
<Series>
<asp:Series Name="Championships" YValueType="Int32" ChartType="Column" ChartArea="MainChartArea">
<Points>
<asp:DataPoint AxisLabel="Celtics" YValues="17" />
<asp:DataPoint AxisLabel="Lakers" YValues="15" />
<asp:DataPoint AxisLabel="Bulls" YValues="6" />
<asp:DataPoint AxisLabel="Spurs" YValues="4" />
<asp:DataPoint AxisLabel="76ers" YValues="3" />
<asp:DataPoint AxisLabel="Pistons" YValues="3" />
<asp:DataPoint AxisLabel="Warriors" YValues="3" />
</Points>
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="MainChartArea">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
I found the answer. I needed to manually add the following to my web.config.
<appSettings>
<add key="ChartImageHandler" value="storage=file;timeout=20;" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
</system.web>
<system.webServer>
<handlers>
<add name="ChartImg" verb="*" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
</system.webServer>
For some reason this was not auto-added when dragging in a chart component. When I started a new, blank asp.net app and dragged a chart onto a blank page, this was added.
What I had to do was set the path correctly in the ChartImageHandler appSetting...
<appSettings>
<add key="ChartImageHandler" value="storage=file;timeout=20;dir=C:\Temp\ChartFiles\;" />
</appSettings>
In CRM 2011 I have several records that contain a two-state (nullable boolean) field. I would like to plot a bar chart that counts the number of true and false values over all the records and plot them in the same chart (a bar for 'true' records and a bar for 'false' records).
Here is the modified XML I (originally generated using CRM) and for the life of me I can't figure out how to plot a chart with the 2 values, I have multiple records per month so the horizontal axis is the records cretedOn date (month).
Can anyone exaplin how I would modify the XML to achieve this? Or point me to a resource that explains what to do?
<visualization>
<visualizationid>{CCA96081-E319-E211-B2CA-0800273EE9D1}</visualizationid>
<name>Compliance Stages 1 & 2, Chart 1</name>
<primaryentitytypecode>intellic_suppliersalesprocess</primaryentitytypecode>
<datadescription>
<datadefinition>
<fetchcollection>
<fetch mapping="logical" aggregate="true">
<entity name="intellic_suppliersalesprocess">
<attribute alias="aggregate_column" name="intellic_csvfileimported" aggregate="count" />
<filter>
<condition attribute="intellic_csvfileimported" operator="eq" value="true" />
</filter>
<attribute alias="aggregate_column1" name="intellic_csvfileimported" aggregate="count" />
<filter>
<condition attribute="intellic_csvfileimported" operator="eq" value="false" />
</filter>
<attribute groupby="true" alias="groupby_column" dategrouping="month" name="createdon" />
</entity>
</fetch>
</fetchcollection>
<categorycollection>
<category>
<measurecollection>
<measure alias="aggregate_column" />
</measurecollection>
<measurecollection>
<measure alias="aggregate_column1" />
</measurecollection>
</category>
</categorycollection>
</datadefinition>
</datadescription>
<presentationdescription>
<Chart>
<Series>
<Series IsValueShownAsLabel="True" Color="110, 20, 78" BackGradientStyle="TopBottom" BackSecondaryColor="141, 44, 45" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series>
<Series IsValueShownAsLabel="True" Color="55, 118, 193" BackGradientStyle="TopBottom" BackSecondaryColor="41, 88, 145" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series>
</Series>
<ChartAreas>
<ChartArea BorderColor="White" BorderDashStyle="Solid">
<AxisY LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount">
<MajorGrid LineColor="239, 242, 246" />
<MajorTickMark LineColor="165, 172, 181" />
<LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" />
</AxisY>
<AxisX LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount">
<MajorGrid LineColor="Transparent" />
<LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" />
</AxisX>
</ChartArea>
</ChartAreas>
<Titles>
<Title Alignment="TopLeft" DockingOffset="-3" Font="{0}, 13px" ForeColor="59, 59, 59"></Title>
</Titles>
</Chart>
</presentationdescription>
<isdefault>false</isdefault>
</visualization>
Any adivce would be much apprecited.
Jack
You need to have two series, and each needs to do an aggregate on the count of records, but for a filtered set of records according to your bit field.
So while a typical two series chart might plot number of new Accounts and number of new Leads (say) in each month, here you want to plot the same entity twice, in each case do a count, but filter the records being counted.
As a useful example to compare against, there is a built-in chart which shows Opportunities as deals won vs deals lost. In this example it does a sum of Actual Revenue for all Opportunities won, and a sum of estimated revenue for Opps lost. You can find this chart and export it, I have pasted below for ease of reference:
<visualization>
<visualizationid>{C1CB81B1-575F-DF11-AE90-00155D2E3002}</visualizationid>
<name>Deals Won vs. Deals Lost By Owner</name>
<description>Shows the amount of revenue for won deals versus lost deals.</description>
<primaryentitytypecode>opportunity</primaryentitytypecode>
<datadescription>
<datadefinition>
<fetchcollection>
<fetch mapping="logical" aggregate="true">
<entity name="opportunity">
<link-entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer">
<attribute alias="sum_lost" name="estimatedvalue" aggregate="sum"></attribute>
<filter>
<condition attribute="statecode" operator="eq" value="2" />
</filter>
</link-entity>
<link-entity name="opportunity" from="opportunityid" to="opportunityid" link-type="outer">
<attribute alias="sum_won" name="actualvalue" aggregate="sum"></attribute>
<filter>
<condition attribute="statecode" operator="eq" value="1" />
</filter>
</link-entity>
<attribute groupby="true" alias="groupby_column" name="ownerid"></attribute>
</entity>
</fetch>
</fetchcollection>
<categorycollection>
<category>
<measurecollection>
<measure alias="sum_won" />
</measurecollection>
<measurecollection>
<measure alias="sum_lost" />
</measurecollection>
</category>
</categorycollection>
</datadefinition>
</datadescription>
<presentationdescription>
<Chart Palette="None" PaletteCustomColors="97,142,206; 168,203,104; 209,98,96; 142,116,178; 93,186,215; 255,155,83; 148,172,215; 217,148,147; 189,213,151; 173,158,196; 145,201,221; 255,180,138">
<Series>
<Series Name="o:opportunity_statecode,1" Color="149, 189, 66" IsValueShownAsLabel="False" BackGradientStyle="TopBottom" BackSecondaryColor="112, 142, 50" Font="{0}, 9.5px" LabelForeColor="59, 59, 59">
<SmartLabelStyle Enabled="True" />
</Series>
<Series Name="o:opportunity_statecode,2" Color="255,124,31" IsValueShownAsLabel="False" BackGradientStyle="TopBottom" BackSecondaryColor="235,98,0" Font="{0}, 9.5px" LabelForeColor="59, 59, 59">
<SmartLabelStyle Enabled="True" />
</Series>
</Series>
<ChartAreas>
<ChartArea BorderColor="White" BorderDashStyle="Solid">
<AxisY LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181">
<MajorGrid LineColor="239, 242, 246" />
<MajorTickMark LineColor="165, 172, 181" />
<LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" />
</AxisY>
<AxisX LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181">
<MajorGrid Enabled="False" />
<MajorTickMark Enabled="False" />
<LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" />
</AxisX>
</ChartArea>
</ChartAreas>
<Titles>
<Title Alignment="TopLeft" DockingOffset="-3" Font="{0}, 13px" ForeColor="0, 0, 0"></Title>
</Titles>
<Legends>
<Legend Alignment="Center" LegendStyle="Table" Docking="Bottom" Font="{0}, 11px" ForeColor="59, 59, 59"></Legend>
</Legends>
</Chart>
</presentationdescription>
<isdefault>false</isdefault>
</visualization>
Notice the "filter" tags in each link-entity? Also see that there are two "measure collections" which define the series, and two entries for the presentation of these eg the colour.
How to set the grid/text colour of an asp:chart?
I'm refering to the colour of the gridlines and the colour of the text on the x and y axis?
Basically I want the black grid and black text below to be shown as white.
In your ChartArea you need to set the X and Y axis colors:
<ChartAreas>
<asp:ChartArea Name="ChartArea1" >
<AxisY>
<MajorGrid LineColor="White" />
<MajorTickMark LineColor="White" />
<LabelStyle ForeColor="White" />
</AxisY>
<AxisX>
<MajorGrid LineColor="White" />
<MajorTickMark LineColor="White" />
<LabelStyle ForeColor="White" />
</AxisX>
</asp:ChartArea>
</ChartAreas>
There are options for MajorGrid, MinorGrid and StripLines. The LabelStyle sets your text.