Курсовая работа: Создание базы данных
1814 Chart. DrawStyle = 0
1815 OldX = x
1816 OldY = y
1817
1818 str_$ = CStr(DiagData(i - 1). Text)
1819 Chart. CurrentX = j * dWidth + (dWidth
- Chart. TextWidth(str_)) \ 2
1820 Chart. CurrentY = ChartDown + Chart. TextHeight(str_)
\ 10
1821 Chart. Print str_
1822
1823 str_ = CStr(Round(DiagData(i - 1). Val
/ Sum * 100)) + "%"
1824 Chart. CurrentX = j * dWidth + (dWidth
- Chart. TextWidth(str_)) \ 2
1825 Chart. CurrentY = y - Chart. TextHeight(str_)
* 1.2
1826 Chart. Print str_
1827
1828 ' значение слева с засечкой и линией
1829 str_ = CStr(DiagData(i - 1). Val)
1830 If UseLineLeftValues Then
1831 Chart. CurrentX = dWidth * 0.8 - Chart.
TextWidth(str_)
1832 Chart. DrawStyle = 2
1833 Chart. Line (dWidth * 0.9, y) - (x, y),
LineColor
1834 Chart. DrawStyle = 0
1835 End If
1836
1837 Chart. DrawWidth = 2
1838 Chart. Line (dWidth * 0.85, y) - (dWidth
* 0.95, y), LineColor
1839 Chart. DrawWidth = 1
1840 x# = dWidth * 0.8 - Chart. TextWidth(str_)
1841 Chart. CurrentX = x
1842 Chart. CurrentY = y - Chart. TextHeight(str_)
\ 2
1843 Chart. Print str_
1844
1845 Case 1 ' // // // // // // // // // //
// // // // // // / КОЛОНКИ // // // // // // // // // // // // // //
// // // // // /
1846 If (Not Use3D) Then
1847 Chart. Line (j * dWidth, y) - ((j + 1)
* dWidth, ChartDown), DiagData(i - 1). Color, BF
1848 Chart. Line (j * dWidth, y) - ((j + 1)
* dWidth, ChartDown), LineColor, B
1849
1850 str_ = CStr(DiagData(i - 1). Text)
1851 Chart. CurrentX = j * dWidth + (dWidth
- Chart. TextWidth(str_)) \ 2
1852 Chart. CurrentY = ChartDown + Chart. TextHeight(str_)
\ 10
1853 Chart. Print str_
1854
1855 str_ = CStr(Round(DiagData(i - 1). Val
/ Sum * 100)) + "%"
1856 Chart. CurrentX = j * dWidth + (dWidth
- Chart. TextWidth(str_)) \ 2
1857 Chart. CurrentY = y - Chart. TextHeight(str_)
* 1.2
1858 Chart. Print str_
1859
1860 ' значение слева с засечкой и линией
1861 str_ = CStr(DiagData(i - 1). Val)
1862 If UseLineLeftValues Then
1863 Chart. CurrentX = dWidth * 0.8 - Chart.
TextWidth(str_)
1864 Chart. DrawStyle = 2
1865 Chart. Line (dWidth * 0.9, y) - (j *
dWidth, y), LineColor
1866 Chart. DrawStyle = 0
1867 End If
1868
1869 x# = dWidth * 0.8 - Chart. TextWidth(str_)
1870 Chart. CurrentX = x
1871 Chart. CurrentY = y - Chart. TextHeight(str_)
\ 2
1872 Chart. Print str_
1873 Chart. CurrentX = x
1874 Chart. CurrentY = y
1875 Chart. DrawWidth = 2
1876 Chart. Line (dWidth * 0.85, y) - (dWidth
* 0.95, y), LineColor
1877 Chart. DrawWidth = 1
1878 Else
1879 For k% = 0 To d3D - 1
1880 Chart. Line (j * dWidth + k * d3DX, y
- k * d3DY) - ((j + 1) * dWidth + k * d3DX, ChartDown - k * d3DY), DiagData(i -
1). Color, B
1881 Next k
1882 Chart. Line (j * dWidth, y) - ((j + 1)
* dWidth, ChartDown), DiagData(i - 1). Color, BF
1883 ' верхняя левая в глубине
1884 ltdx% = j * dWidth + (d3D - 1) * d3DX
1885 ltdy% = y - (d3D - 1) * d3DY
1886 ' верхняя правая в глубине
1887 rtdx% = (j + 1) * dWidth + (d3D - 1) *
d3DX
1888 rtdy% = y - (d3D - 1) * d3DY
1889 ' нижняя правая в глубине
1890 rddx% = (j + 1) * dWidth + (d3D - 1) * d3DX
1891 rddy% = ChartDown - (d3D - 1) * d3DY
1892 ' верхняя в глубине
1893 Chart. Line (rtdx, rtdy) - (rddx, rddy),
LineColor
1894 ' правая в глубине
1895 Chart. Line
(ltdx, ltdy) - (rtdx, rtdy), LineColor
1896
1897 ' левая переходная
1898 Chart. Line (ltdx, ltdy) - (ltdx - d3D
* d3DX, ltdy + d3D * d3DY), LineColor
1899 ' правая верхняя переходная
1900 Chart. Line
(rtdx, rtdy) - (rtdx - d3D * d3DX, rtdy + d3D * d3DY), LineColor
1901 ' правая нижняя переходная
1902 Chart. Line
(rddx, rddy) - (rddx - d3D * d3DX, rddy + d3D * d3DY), LineColor
1903 Chart. Line (j * dWidth, y) - ((j + 1)
* dWidth, ChartDown), LineColor, B
1904
1905 ' надпись внизу
1906 str_ = CStr(DiagData(i - 1). Text)
1907 Chart. CurrentX = j * dWidth + (dWidth
- Chart. TextWidth(str_)) \ 2
1908 Chart. CurrentY = ChartDown + Chart. TextHeight(str_)
\ 10
1909 Chart. Print str_
1910 ' процент вверху
1911 str_ = CStr(Round(DiagData(i - 1). Val
/ Sum * 100)) + "%"
1912 Chart. CurrentX = d3D * d3DX + j *
dWidth + (dWidth - Chart. TextWidth(str_)) \ 2
1913 Chart. CurrentY = y - d3D * d3DY - Chart.
TextHeight(str_) * 1.2
1914 Chart. Print str_
1915 ' значение слева с засечкой и линией
1916 str_ = CStr(DiagData(i - 1). Val)
1917 If UseLineLeftValues Then
1918 Chart. CurrentX = dWidth * 0.8 - Chart.
TextWidth(str_)
1919 Chart. DrawStyle = 2
1920 Chart. Line (dWidth * 0.9, y) - (j *
dWidth, y), LineColor
1921 Chart. DrawStyle = 0
1922 End If
1923
1924 x# = dWidth * 0.8 - Chart. TextWidth(str_)
1925 Chart. CurrentX = x
1926 Chart. CurrentY = y - Chart. TextHeight(str_)
\ 2
1927 Chart. Print str_
1928 Chart. CurrentX = x
1929 Chart. CurrentY = y
1930 Chart. DrawWidth = 2
1931 Chart. Line (dWidth * 0.85, y) - (dWidth
* 0.95, y), LineColor
1932 Chart. DrawWidth = 1
1933 End If
1934
1935 Case 2 ' // // // // // // // // // //
// // // // // // / ТОЧКИ // // // // // // // // // // // // // //
// // // // // // /
1936 Chart. FillStyle = 0
1937 Chart. FillColor = DiagData(i - 1). Color
1938 x# = (j + 0.5) * dWidth
1939 Chart. Circle (x, y), PointRadius *
d3DX, LineColor
1940 Chart. FillStyle = 1
1941 Chart. DrawStyle = 1
1942 Chart. Line (x, y) - (x, ChartDown),
DiagData(i - 1). Color
1943 Chart. DrawStyle = 0
1944
1945 str_ = CStr(DiagData(i - 1). Text)
1946 Chart. CurrentX = j * dWidth + (dWidth
- Chart. TextWidth(str_)) \ 2
1947 Chart. CurrentY = ChartDown + Chart. TextHeight(str_)
\ 10
1948 Chart. Print str_
1949
1950 str_ = CStr(Round(DiagData(i - 1). Val
/ Sum * 100)) + "%"
1951 Chart. CurrentX = j * dWidth + (dWidth
- Chart. TextWidth(str_)) \ 2
1952 Chart. CurrentY = y - PointRadius *
d3D - Chart. TextHeight(str_) * 1.2
1953 Chart. Print str_
1954
1955 ' значение слева с засечкой и линией
1956 str_ = CStr(DiagData(i - 1). Val)
1957 Chart. CurrentX = dWidth * 0.8 - Chart.
TextWidth(str_)
1958 Chart. DrawStyle = 2
1959 Chart. Line (dWidth * 0.9, y) - (x, y),
LineColor
1960 Chart. DrawStyle = 0
1961
1962 Chart. DrawWidth = 2
1963 Chart. Line (dWidth * 0.85, y) - (dWidth
* 0.95, y), LineColor
1964 Chart. DrawWidth = 1
1965 x# = dWidth * 0.8 - Chart. TextWidth(str_)
1966 Chart. CurrentX = x
1967 Chart. CurrentY = y - Chart. TextHeight(str_)
\ 2
1968 Chart. Print str_
1969 End Select
1970 Next i
1971
1972 End With
1973End Sub
1974
1975Sub DrawDiagram()
1976 If (Chart. Height > Screen. TwipsPerPixelX
* 5) And (UseColorFill) Then
1977 Call ColorFill(Chart, StartFillColor,
EndFillColor)
1978 Else
1979 Chart. Line (0, 0) - (Chart. Width,
Chart. Height), StartFillColor, BF
1980 End If
1981
1982 Select Case DrawingMode
1983 Case 3: Call DrawCircle
1984 Case Else: Call DrawPoint
1985 End Select
1986End Sub
1987
1988Private Sub Chart_MouseMove(Button As
Integer, Shift As Integer, x As Single, y As Single)
1989 If (DrawingMode <> 3) Then
1990 y = Round((ChartDown - y) * Max /
(ChartDown - ChartTop))
1991 Label3. Caption = CStr(y)
1992 End If
1993End Sub
1994
1995Private Sub Form_KeyDown(KeyCode As
Integer, Shift As Integer)
1996 If (KeyCode = vbKeyF5) Then Call
DrawDiagram
1997End Sub
1998
1999Private Sub Form_Load()
2000 dW = Width - Chart. Width
2001 dH = Height - Chart. Height
2002 dX = Width - VScroll. Left
2003 dH2 = Height - VScroll. Height
2004 DrawingMode = 0
2005 Use3D = False
2006 LineCount = 100
2007 d3D = 15
2008 StartFillColor = RGB(255, 255, 128)
2009 EndFillColor = RGB(0, 128, 255)
2010 LineColor = 0
2011 LineWidth = 1
2012 Ellipce = 2 / 5
2013 PointRadius = 15
2014
2015 UseColorFill = True
2016 UseCircleLegend = True
2017 UseLineLeftValues = True
2018
2019 ChartHeight = Chart. Height * 0.85
2020 ChartWidth = Chart. Width * 0.85
2021 ChartTop = Chart. Height * 0.075
2022 ChartDown = Chart. Height * 0.925
2023 If (ChartWidth < ChartHeight) Then
Radius = ChartWidth Else Radius = ChartHeight
2024 Radius = Radius * 0.5
2025 InRad = 0.1 * Radius
2026End Sub
2027
2028Private Sub Form_Resize()
2029 Min% = Width - dW + 5 * Screen. TwipsPerPixelX
2030 If (Min < 0) Then Min = 0
2031 Chart. Width = Min
2032
2033 Min% = Height - dH + Screen. TwipsPerPixelY
2034 If (Min < 0) Then Min = 0
2035 Chart. Height = Min
2036
2037 VScroll. Left = Width - dX
2038
2039 Min% = Height - dH2 + Screen. TwipsPerPixelY
2040 If (Min < 0) Then Min = 0
2041 VScroll. Height = Min
2042
Страницы: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 |