瀏覽代碼

微调图表

user_zyx 11 月之前
父節點
當前提交
8b0266cc8a

+ 1 - 1
B20UVLog/Charts/CSS/Main.css

@@ -23,7 +23,7 @@ input{
 }
 .echartsDiv{
 	width: 100%;
-	height: 400px;
+	height: 600px;
 	/*position: absolute;*/
 }
 .div-cover{

+ 4 - 7
B20UVLog/Charts/Htmls/AxisData.html

@@ -68,15 +68,12 @@
                     data: DataX
                 },
                 yAxis: {
+                    name: '单位:mm',
                     type: 'value',
-                    axisLable: {
-                        formatter: '{value}mm'
-                    },
-                    boundaryGap: [0, '50%'],
                     scale: true,
-                    splitLine: {
-                        show: false
-                    }
+                    //splitLine: {
+                    //    show: false
+                    //}
                 },
                 series: [
                     {

+ 5 - 5
B20UVLog/Charts/Htmls/AxisData1.html

@@ -68,15 +68,15 @@
                     data: DataX
                 },
                 yAxis: {
+                    name: '单位:mm',
                     type: 'value',
-                    axisLable: {
+                    axisLabel: {
                         formatter: '{value}mm'
                     },
-                    boundaryGap: [0, '50%'],
                     scale: true,
-                    splitLine: {
-                        show: false
-                    }
+                    //splitLine: {
+                    //    show: false
+                    //}
                 },
                 series: [
                     {

+ 4 - 7
B20UVLog/Charts/Htmls/AxisData2.html

@@ -66,15 +66,12 @@
                     data: DataX
                 },
                 yAxis: {
+                    name: '单位:mm',
                     type: 'value',
-                    axisLable: {
-                        formatter: '{value}mm'
-                    },
-                    boundaryGap: [0, '50%'],
                     scale: true,
-                    splitLine: {
-                        show: false
-                    }
+                    //splitLine: {
+                    //    show: false
+                    //}
                 },
                 series: [
                     {

+ 45 - 15
B20UVLog/Charts/Htmls/AxisData3.html

@@ -57,24 +57,52 @@
                 tooltip: {
                     trigger: 'axis'
                 },
-                xAxis: {
-                    type: 'category',
-                    splitLine: {
-                        show: false
-                    },
-                    data: DataX
+                axisPointer: {
+                    link: { xAxisIndex: 'all' }
                 },
-                yAxis: {
-                    type: 'value',
-                    axisLable: {
-                        formatter: '{value}mm'
+                grid: [{
+                    height: '35%'
+                }, {
+                    top: '55%',
+                    height: '35%'
+                }],
+                xAxis: [
+                    {
+                        type: 'category',
+                        splitLine: {
+                            show: false
+                        },
+                        data: DataX
+                    },
+                    {
+                        gridIndex: 1,
+                        type: 'category',
+                        splitLine: {
+                            show: false
+                        },
+                        data: DataX,
+                        position: 'bottom'
+                    }],
+                yAxis: [
+                    {
+                        type: 'value',
+                        name: '单位:mm',
+                        scale: true,
+                        //splitLine: {
+                        //    show: false
+                        //}
                     },
-                    boundaryGap: [0, '50%'],
-                    scale: true,
-                    splitLine: {
-                        show: false
+                    {
+                        gridIndex: 1,
+                        type: 'value',
+                        name: '单位:度',
+                        scale: true,
+                        //splitLine: {
+                        //    show: false
+                        //}
                     }
-                },
+                ],
+
                 series: [
                     {
                         name: 'CSXR',
@@ -91,6 +119,8 @@
                     {
                         name: 'CSZR',
                         type: 'line',
+                        xAxisIndex: 1,
+                        yAxisIndex: 1,
                         showSymbol: false,
                         data: myData3
                     }

+ 4 - 7
B20UVLog/Charts/Htmls/AxisData4.html

@@ -63,14 +63,11 @@
                 },
                 yAxis: {
                     type: 'value',
-                    axisLable: {
-                        formatter: '{value}mm'
-                    },
-                    boundaryGap: [0, '50%'],
+                    name: '单位:mm',
                     scale: true,
-                    splitLine: {
-                        show: false
-                    }
+                    //splitLine: {
+                    //    show: false
+                    //}
                 },
                 series: [
                     {

+ 2 - 2
B20UVLog/Windows/Chart.xaml

@@ -6,12 +6,12 @@
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:B20UVLog.Windows" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
              mc:Ignorable="d"
-        Title="Axis Data 图表" Height="600" Width="1000"
+        Title="Axis Data 图表" Height="700" Width="1200"
         WindowStyle="ToolWindow">
     <Window.DataContext>
         <viewmodels:AxisDataViewModel/>
     </Window.DataContext>
     <Grid>
-        <WebBrowser x:Name="WBrowser" Height="480" Width="800" LoadCompleted="WBrowser_LoadCompleted"/>
+        <WebBrowser x:Name="WBrowser"  LoadCompleted="WBrowser_LoadCompleted"/>
     </Grid>
 </My:MWindow>

+ 1 - 1
B20UVLog/Windows/PLCSet.xaml

@@ -45,7 +45,7 @@
             <My:MButton Type="Primary" x:Name="BtnReadPLC" Content="读取" Click="BtnReadPLC_Click" />
             <My:MButton Type="Primary"  x:Name="BtnWritePLC" Content="写入" Click="BtnWritePLC_Click" />
         </WrapPanel>
-        <RichTextBox x:Name="RtbRunLog" Grid.Row="2">
+        <RichTextBox x:Name="RtbRunLog" Grid.Row="2" Margin="5">
             <FlowDocument>
             </FlowDocument>
         </RichTextBox>