小编jsa*_*ics的帖子

如何更改 Xceed WPF DateTimePicker 的日历大小

我正在使用 Xceed DateTimePicker 控件。问题在于它的日历大小:当您放大控件本身的字体时,其弹出日历的大小和字体不会改变。如何更改弹出窗口的大小?

.net c# wpf xaml xceed

4
推荐指数
1
解决办法
2367
查看次数

如何在Mahapps中获取ShowInputAsync对话框的结果

ShowInputAsync()返回一个字符串,但我想要得到的结果,我的意思是宣誓或取消,从对话框。

.net c# wpf xaml mahapps.metro

4
推荐指数
1
解决办法
983
查看次数

在图表中添加 x 轴字符串值而不是数字

我正在尝试设计一个图表,其中 x 表示异常消息,y 表示它发生的次数。

我无法在每个条形下显示 x 值(异常消息),我还尝试标记 x 并为每个标签设置范围,但条形不是在此标签上生成的,而是远离它们生成的。

这是我的代码示例

 reportChart.Series.Add(exception);
 reportChart.Series[exception].SetDefault(true);
 reportChart.Series[exception].Enabled = true;
 reportChart.Series[exception].Points.AddXY(exception,ExceptionMessages[exception]);
Run Code Online (Sandbox Code Playgroud)

ExceptionMessages[exception] 是一个包含当前异常发生次数的值的字典。

.net c# charts mschart winforms

3
推荐指数
1
解决办法
6880
查看次数

ASP.Net 中的图表助手显示日期时间

在 asp.net mvc 应用程序中,我需要创建一个简单的折线图,所以我尝试了 Chart helper。该图表是使用两个列表创建的,x 轴应显示日期时间,y 轴应显示每次的值。现在使用下面的代码可以正常工作。“listOfDateTimes”包含一个日期时间列表。

    var chart = new Chart(width: 1000, height: 300, theme: ChartTheme.Green)
        .AddSeries(
                    chartType: "line",
                    xValue: listOfDateTimes,
                    yValues:  listOfValues )
                    .GetBytes("png");
Run Code Online (Sandbox Code Playgroud)

问题是 x 轴下方的日期时间显示为“MM/dd/yyyy”,但我还需要显示小时和分钟。我不知道如何使用图表助手解决这个问题。

.net c# asp.net asp.net-mvc charts

3
推荐指数
1
解决办法
1116
查看次数

使用颜色指示器 ASP.NET 图表添加自定义图例

直接.. 请问如何在图表底部创建自定义图例?

传说是..红色低床号

设计器中的代码:

                <asp:Chart ID="ChartClass" Visible="false" runat="server" Height="500px" Width="720px"> 
                <Series>
                    <asp:Series Name="SeriesAvailableClass" IsValueShownAsLabel="True" LabelAngle="-90" Font="Microsoft Sans Serif, 12pt" Legend="LegendClass" ChartArea="ChartAreaClass" ChartType="Column">
                        <SmartLabelStyle Enabled="false" />
                    </asp:Series>
                    <asp:Series Name="SeriesAllotedClass" IsValueShownAsLabel="True" LabelAngle="-90" Font="Microsoft Sans Serif, 12pt" Legend="LegendClass" ChartArea="ChartAreaClass" ChartType="Column">
                        <SmartLabelStyle Enabled="false"/>
                    </asp:Series>
                </Series>
                <ChartAreas>
                    <asp:ChartArea Name="ChartAreaClass">
                        <AxisX Title="Class">
                            <MajorGrid Enabled="false" />
                        </AxisX>
                        <AxisY Title="Number of Beds">
                            <MajorGrid Enabled="false" />
                        </AxisY>
                    </asp:ChartArea>
                </ChartAreas>
                <Legends>
                    <asp:Legend Docking="Bottom" Name="LegendClass"></asp:Legend>
                </Legends>
                <Titles>
                    <asp:Title Name="TitleChart" Font="Microsoft Sans Serif, 15pt, style=Bold" Text="Beds Statistics Summary (Class)" Alignment="TopCenter"></asp:Title> …
Run Code Online (Sandbox Code Playgroud)

.net c# asp.net data-visualization

3
推荐指数
1
解决办法
8631
查看次数

GridLines背后的OxyPlot AreaSeries

我使用了AreaSeries在图表上显示彩色区域.

在此输入图像描述

彩色区域呈现在网格线的顶部.有没有办法将网格线带到前面?

此图在WPF项目的XAML中定义.这是配置:

    <oxy:Plot Grid.Row="1"
          Margin="0"
          HorizontalAlignment="Stretch"
          VerticalAlignment="Stretch"
          PlotType="XY"
          TitleFontSize="11"
          IsLegendVisible="False"
          Title="{Binding Channel.Name}"
          InvalidateFlag="{Binding Refresh}">
      <oxy:Plot.Axes>
        <oxy:LinearAxis Key="yAxis"
                    IsZoomEnabled="False"
                    IsPanEnabled="False"
                    Position="Left"
                    MajorGridlineStyle="Dot"
                    MajorGridlineColor="LightGray"
                    Title="Speed [m/s]"
                    Maximum="{Binding SpeedXDistance_MaxY}"/>
        <oxy:LinearAxis Key="xAxis"
                    IsZoomEnabled="False"
                    IsPanEnabled="False"
                    Position="Bottom"
                    MajorGridlineStyle="Dot"
                    MajorGridlineColor="LightGray"
                    Title="Distance [m]"
                    Maximum="{Binding SpeedXDistance_MaxX}"/>
      </oxy:Plot.Axes>
      <oxy:Plot.Series>
        <oxy:LineSeries ItemsSource="{Binding SpeedXDistancePoints}"
                        DataFieldX="X"
                        DataFieldY="Y"
                        StrokeThickness="1"
                        MarkerSize="0"
                        LineStyle="Solid"
                        Color="Blue"
                        MarkerType="None"/>
        <oxy:AreaSeries ItemsSource="{Binding SpeedXDistanceUpperLimit}"
                        Fill="AliceBlue"
                        DataFieldX="X"
                        DataFieldY="Y"
                        StrokeThickness="1"
                        MarkerSize="0"
                        LineStyle="Solid"
                        Color="DarkGray"
                        MarkerType="None"/>
      </oxy:Plot.Series>
    </oxy:Plot>
Run Code Online (Sandbox Code Playgroud)

任何帮助,将不胜感激.

c# wpf charts xaml oxyplot

3
推荐指数
1
解决办法
2542
查看次数

无法使用foreach获取XML值

我想使用foreach获取subdata和subdata2值,但由于某种原因,我得到一个空引用异常.

XML:

<project>
<name>Name1</name>
<data>
    <subdata>1</subdata>
    <subdata2>1</subdata2>
</data>
<data>
    <subdata>3</subdata>
    <subdata2>2</subdata2>
</data>
</project>
Run Code Online (Sandbox Code Playgroud)

码:

XmlNode datanode = doc.DocumentElement.SelectSingleNode("/project/data");
XmlNode innerDataNode;
foreach (XmlNode dataVar in datanode)
{
    innerDataNode = datanode.SelectSingleNode("/subdata");
    int subdataVal = XmlConvert.ToInt16(innerDataNode.InnerText);
    //(...)
}
Run Code Online (Sandbox Code Playgroud)

例外:

System.NullReferenceException:'对象引用未设置为对象的实例.innerDataNode为null.

我究竟做错了什么?

c# xml nullreferenceexception

3
推荐指数
1
解决办法
83
查看次数

在 ASP.NET 图表控件中水平对齐图表区域

我在单个图表控件中有两个图表区域 Chartarea1 和 Chartarea2。

但是这是垂直对齐的,我想水平对齐它。我使用了 AlignmentOrientation="Horizo​​ntal" 但没有帮助。

我得到如下输出:

在此处输入图片说明

但我需要输出为: 在此处输入图片说明

<asp:Chart ID="chartTest" runat="server" EnableViewState="true" Visible="false" Width="650px"><Titles><asp:Title Text="Test" Font="Arial, 11pt, style=Bold" /></Titles><Series><!--have few series here --></Series><ChartAreas><asp:ChartArea Name="ChartArea1" Area3DStyle-Enable3D="false"><Area3DStyle Enable3D="false" WallWidth="3" LightStyle="Realistic"></Area3DStyle></asp:ChartArea><asp:ChartArea Name="ChartArea2" Area3DStyle-Enable3D="false"><Area3DStyle Enable3D="false" WallWidth="3" LightStyle="Realistic"></Area3DStyle></asp:ChartArea></ChartAreas></asp:Chart>
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激。

.net c# asp.net charts mschart

2
推荐指数
1
解决办法
2854
查看次数

WPF DataGrid - 行选择/失去焦点防止颜色变化

当数据网格失去焦点并选择了其中一行时,我想防止我的程序更改行的颜色。我现在拥有的代码是:

        <DataGrid.Resources>
            <SolidColorBrush 
            x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" 
                     Color="Red"/>
        </DataGrid.Resources>
Run Code Online (Sandbox Code Playgroud)

我正在寻找类似的东西

颜色="保持不变"

.net c# wpf xaml datagrid

2
推荐指数
1
解决办法
4796
查看次数

Xamarin.Forms:Oxyplot占用整个页面

我已经使用Xamarin.Forms中的oxyplot成功生成了一个情节,但是我无法阻止整个页面的氧气图.

我在旋转木马的其他页面上使用stacklayout,并且在每个页面上都有一个横幅作为嵌入式stacklayout,并且希望将绘图显示在下面的嵌入式stacklayout中.

但横幅短暂出现,然后由氧气图写过.

我发现引用Grid应该使用Grid而不是stacklayout,因为存在已知问题,但网格也不起作用.

任何帮助感激不尽!这可能是一个约束性问题,例如,如果我删除Model ="{Binding Model}"它仍然有效!它忽略了HeightRequest ="100"而只是填充页面.我显然在这里遗漏了一些东西.

这是xaml代码,我已经注释掉了网格尝试,"oxy:PlotView"中的各种选项是我尝试的最后一个:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage 
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="RentGuru2.PieCosts"
xmlns:oxy="clr-namespace:OxyPlot.Xamarin.Forms;assembly=OxyPlot.Xamarin.Forms"
Padding="0, 20, 0, 0"
BackgroundColor="#21b09c">

<StackLayout Orientation="Vertical">
    <StackLayout Orientation="Horizontal" BackgroundColor="#21b09c" HeightRequest="60">
        <Image Source = "BannerLogo.png"  />
        <Label Text="Costs breakdown" FontSize="Large" TextColor="White" Margin="10" VerticalTextAlignment="Center"/>
    </StackLayout>
    <StackLayout HeightRequest="300">
        <oxy:PlotView Model="{Binding Model}" VerticalOptions="Center" HorizontalOptions="FillAndExpand"
                  HeightRequest="100" WidthRequest="100" />
    </StackLayout>
</StackLayout>

<!--<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="5*" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="60" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>

    <Image Grid.Row="0" Grid.Column ="0" Source = "BannerLogo.png"  />
    <Label …
Run Code Online (Sandbox Code Playgroud)

c# xaml oxyplot xamarin.forms

2
推荐指数
1
解决办法
544
查看次数