HỎi về dạng biểu đồ mới

Liên hệ QC

thuynhung1979

Thành viên mới
Tham gia
22/2/08
Bài viết
25
Được thích
8
Chao cac bạn, mình có biểu đồ này khó quá, nhờ các bạn giúp mình với.
Trong đó khi kích vào thanh cuộn thì hiện 5 trade 1 lần. CÁc mũi tên chỉ số lượng lớn nhất và nhỏ nhất, dữ liệu đó hiện trong mũi tên
 

File đính kèm

  • hoi5.rar
    91.2 KB · Đọc: 98
Đó là 1 picture của biểu đồ, đâu phải bản thân cái biểu đồ. Khi thay dữ liệu nó có nhúc nhích đâu?
 
Có thể dùng scroll bar kết hợp có thể vẽ được biểu đồ theo kiểu này.
Tuy nhiên hiện tại tôi chỉ có thể làm theo kiểu tạo ra một data động theo scroll bar rồi biểu đồ sẽ động theo data đó.
Nhờ các bác cao thủ thể hiện tiếp.
 

File đính kèm

  • hoi5.zip
    9.3 KB · Đọc: 60
Đoạn 1 scroll chart của OverAC xem như ổn, đoạn 2 mũi tên chỉ ở 2 điểm có lẽ nên gài thêm VBA vào mỗi Event scroll change, viết code
PHP:
Sub ScrollBar2_Change()
GET.CHART.ITEM
....
hoặc lấy số liệu thay đổi trực tiếp từ các cell/ range trước và sau khi scroll
....
lấy hiệu số này để điều khiển mũi tên

xác định tọa độ điểm 3 và 5 so với thời điểm trước đó nếu tăng, sơn lại mũi tên màu xanh, quay lên, nếu giảm - đỏ - quay xuống!

End Sub

Đây là ý tưởng, muộn quá, không kịp làm ra nhưng các bạn có thể tham khảo đoạn code này:

Locating Chart Items
Sometimes, however hard we try, the only way to get a chart looking exactly how we want it is to add drawing objects to it, such as rectangles, lines, arrows and so on. As soon as we do that, we hit the problem of trying to identify where in the drawing object coordinate space an item on the chart is located, such as the top middle of a specific column in a column chart.

That level of positional information cannot be obtained through the Excel object model, but can be obtained by calling on the long-disused XLM function GET.CHART.ITEM. This function has the following parameters:

GET.CHART.ITEM(x_y_index, point_index, item_text)



Where:

x_y_index is 1 to return the x position and 2 to return the y position.

point_index depends on the item we're looking at, but is a number from 1 to 8 to identify a specific vertex within the item. For example, 2 is the upper middle of any rectangular item, such as a column in a column chart.

item_text identifies the item we're interested in, such as "Plot" for the plot area, or "S2P4" for the fourth data point in the second series in the chart.

The full list of available parameters can be found in the XLM Macros help file available for download from the Microsoft Web site at http://support.microsoft.com/?kbid=128175. The only caveat with using GET.CHART.ITEM is that the chart must be active for it to work. The code in Listing 15-3 moves an arrow on a chart to be from the top-left corner of the inside of the plot area (using normal VBA positioning) to the top middle of the third column of a column chart, resulting in the chart shown in Figure 15-16.

Listing 15-3. Using GET.CHART.ITEM to Locate a Chart Item's Vertices
PHP:
Private Sub cmdMoveArrow_Click()

  Dim rngActive As Range
  Dim dXVal As Double
  Dim dYVal As Double
  Dim chtChart As Chart

  Set rngActive = ActiveCell

  'We have to activate the chart to use GET.CHART.ITEM
  Me.ChartObjects(1).Activate

  'Find the XY position of the middle top of the third column 
  'in the data series,
  'returned in XLM coordinates
  dXVal = ExecuteExcel4Macro("GET.CHART.ITEM(1,2,""S1P3"")")
  dYVal = ExecuteExcel4Macro("GET.CHART.ITEM(2,2,""S1P3"")")

  'Get the Chart
  Set chtChart = Me.ChartObjects(1).Chart
  With chtChart

    'Convert the XLM coordinates to Drawing Object coordinates
    'The x values are the same, but the Y values need to be 
    'flipped
    dYVal = .ChartArea.Height - dYVal

    'Move and size the Arrow
    .Shapes("linArrow").Left = .PlotArea.InsideLeft
    .Shapes("linArrow").Top = .PlotArea.InsideTop
    .Shapes("linArrow").Width = dXVal - .Shapes("linArrow").Left
    .Shapes("linArrow").Height = dYVal - .Shapes("linArrow").Top
  End With

  rngActive.Activate

End Sub
 
File bác bị virus rồi. Em gửi file sạch lên đây.
 

File đính kèm

  • hoi5.rar
    13.4 KB · Đọc: 34
Lần chỉnh sửa cuối:
Đây là bản Demo, very alpha
 

File đính kèm

  • hoi5_099.rar
    107.2 KB · Đọc: 155
Có thể dùng scroll bar kết hợp có thể vẽ được biểu đồ theo kiểu này.
Tuy nhiên hiện tại tôi chỉ có thể làm theo kiểu tạo ra một data động theo scroll bar rồi biểu đồ sẽ động theo data đó.
Nhờ các bác cao thủ thể hiện tiếp.


DOWNLOAD FILE :
rar.gif
hoi5_099 boyxin.rar
(trong file có hướng dẫn cách tạo nút Up Arrow, Down Arrow)​
 
Lần chỉnh sửa cuối:
Web KT
Back
Top Bottom