Module: Tk::Tcllib::Plotchart::ChartMethod

Includes:
TkCore
Included in:
Barchart, Barchart3D, Boxplot, Ganttchart, IsometricPlot, Piechart, Plot3D, PolarPlot, Radialchart, RibbonChart3D, RightAxis, Timechart, XYPlot
Defined in:
lib/tkextlib/tcllib/plotchart.rb

Constant Summary

Constants included from TkCore

TkCore::EventFlag, TkCore::INTERP, TkCore::INTERP_MUTEX, TkCore::INTERP_ROOT_CHECK, TkCore::INTERP_THREAD, TkCore::INTERP_THREAD_STATUS, TkCore::RUN_EVENTLOOP_ON_MAIN_THREAD, TkCore::WIDGET_DESTROY_HOOK, TkCore::WITH_ENCODING, TkCore::WITH_RUBY_VM

Constants included from TkComm

TkComm::GET_CONFIGINFO_AS_ARRAY, TkComm::GET_CONFIGINFOwoRES_AS_ARRAY, TkComm::TkExtlibAutoloadModule, TkComm::Tk_CMDTBL, TkComm::Tk_IDs, TkComm::Tk_WINDOWS, TkComm::USE_TCLs_LIST_FUNCTIONS, TkComm::WidgetClassNames

Constants included from TkUtil

TkUtil::None, TkUtil::RELEASE_DATE

Instance Method Summary collapse

Methods included from TkCore

#_tk_call_to_list_core, #after, #after_cancel, #after_idle, #appname, #appsend, #appsend_deny, #appsend_displayof, callback, #callback_break, #callback_continue, #callback_return, #chooseColor, #chooseDirectory, #do_one_event, #event_generate, #getMultipleOpenFile, #getMultipleSaveFile, #getOpenFile, #getSaveFile, #get_eventloop_tick, #get_eventloop_weight, #get_no_event_wait, #inactive, #inactive_displayof, #info, #ip_eval, #ip_eval_with_enc, #ip_eval_without_enc, #ip_invoke, #ip_invoke_with_enc, #ip_invoke_without_enc, #is_mainloop?, #load_cmd_on_ip, #mainloop, #mainloop_exist?, #mainloop_thread?, #mainloop_watchdog, #messageBox, #rb_appsend, #rb_appsend_displayof, #reset_inactive, #reset_inactive_displayof, #restart, #scaling, #scaling_displayof, #set_eventloop_tick, #set_eventloop_weight, #set_no_event_wait, #tk_call, #tk_call_to_list, #tk_call_to_list_with_enc, #tk_call_to_list_without_enc, #tk_call_to_simplelist, #tk_call_to_simplelist_with_enc, #tk_call_to_simplelist_without_enc, #tk_call_with_enc, #tk_call_without_enc, #windowingsystem

Methods included from TkComm

_at, _callback_entry?, _callback_entry_class?, _curr_cmd_id, _fromUTF8, _genobj_for_tkwidget, _next_cmd_id, _toUTF8, array2tk_list, #bind, #bind_all, #bind_append, #bind_append_all, #bind_remove, #bind_remove_all, #bindinfo, #bindinfo_all, bool, image_obj, #install_cmd, install_cmd, list, num_or_nil, num_or_str, number, procedure, simplelist, slice_ary, string, #subst, tk_tcl2ruby, uninstall_cmd, #uninstall_cmd, window

Methods included from TkEvent

#install_bind, #install_bind_for_event_class

Methods included from TkUtil

#_conv_args, _conv_args, #_fromUTF8, #_get_eval_enc_str, _get_eval_enc_str, #_get_eval_string, _get_eval_string, _symbolkey2str, #_symbolkey2str, #_toUTF8, #bool, bool, callback, eval_cmd, #hash_kv, hash_kv, install_cmd, #num_or_nil, num_or_nil, num_or_str, #num_or_str, number, #number, string, #string, uninstall_cmd, untrust

Instance Method Details

#background(part, color_or_image, dir) ⇒ Object



199
200
201
202
203
# File 'lib/tkextlib/tcllib/plotchart.rb', line 199

def background(part, color_or_image, dir)
  tk_call_without_enc(@chart, 'background',
                      part, color_or_image, dir)
  self
end

#balloon(*args) ⇒ Object

args => (x, y, text, dir) or ([x, y], text, dir)



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/tkextlib/tcllib/plotchart.rb', line 230

def balloon(*args) # args => (x, y, text, dir) or ([x, y], text, dir)
  if args[0].kind_of?(Array)
    # args => ([x, y], text, dir)
    x, y = args.shift
  else
    # args => (x, y, text, dir)
    x = args.shift
    y = args.shift
  end

  text, dir = args

  tk_call_without_enc(@chart, 'balloon', x, y,
                      _get_eval_enc_str(text), dir)
  self
end

#balloonconfig(key, value = None) ⇒ Object



247
248
249
250
251
252
253
# File 'lib/tkextlib/tcllib/plotchart.rb', line 247

def balloonconfig(key, value=None)
  if key.kind_of?(Hash)
    tk_call_without_enc(@chart, 'balloonconfig', *hash_kv(key, true))
  else
    tk_call(@chart, 'balloonconfig', "-#{key}", value)
  end
end

#coords_3D_to_pixel(x, y, z) ⇒ Object



296
297
298
# File 'lib/tkextlib/tcllib/plotchart.rb', line 296

def coords_3D_to_pixel(x, y, z)
  list(tk_call_without_enc('::Plotchart::coords3DToPixel', @path, x, y, z))
end

#coords_to_pixel(x, y) ⇒ Object



292
293
294
# File 'lib/tkextlib/tcllib/plotchart.rb', line 292

def coords_to_pixel(x, y)
  list(tk_call_without_enc('::Plotchart::coordsToPixel', @path, x, y))
end

#determine_scale(xmax, ymax) ⇒ Object



318
319
320
321
# File 'lib/tkextlib/tcllib/plotchart.rb', line 318

def determine_scale(xmax, ymax)
  tk_call_without_enc('::Plotchart::determineScale', @path, xmax, ymax)
  self
end

#legend(series, text) ⇒ Object



224
225
226
227
228
# File 'lib/tkextlib/tcllib/plotchart.rb', line 224

def legend(series, text)
  tk_call_without_enc(@chart, 'legend',
                      _get_eval_enc_str(series), _get_eval_enc_str(text))
  self
end

#legendconfig(key, value = None) ⇒ Object



215
216
217
218
219
220
221
222
# File 'lib/tkextlib/tcllib/plotchart.rb', line 215

def legendconfig(key, value=None)
  if key.kind_of?(Hash)
    tk_call_without_enc(@chart, 'legendconfig', *hash_kv(key, true))
  else
    tk_call(@chart, 'legendconfig', "-#{key}", value)
  end
  self
end

#pixel_to_coords(x, y) ⇒ Object



314
315
316
# File 'lib/tkextlib/tcllib/plotchart.rb', line 314

def pixel_to_coords(x, y)
  list(tk_call_without_enc('::Plotchart::pixelToCoords', @path, x, y))
end

#plaintext(*args) ⇒ Object

args => (x, y, text, dir) or ([x, y], text, dir)



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/tkextlib/tcllib/plotchart.rb', line 255

def plaintext(*args) # args => (x, y, text, dir) or ([x, y], text, dir)
  if args[0].kind_of?(Array)
    # args => ([x, y], text, dir)
    x, y = args.shift
  else
    # args => (x, y, text, dir)
    x = args.shift
    y = args.shift
  end

  text, dir = args

  tk_call_without_enc(@chart, 'plaintext', x, y,
                      _get_eval_enc_str(text), dir)
  self
end

#plotpack(dir, *plots) ⇒ Object



300
301
302
303
# File 'lib/tkextlib/tcllib/plotchart.rb', line 300

def plotpack(dir, *plots)
  tk_call_without_enc('::Plotchart::plotpack', @path, dir, *plots)
  self
end

#polar_coordinates(radmax) ⇒ Object



305
306
307
308
# File 'lib/tkextlib/tcllib/plotchart.rb', line 305

def polar_coordinates(radmax)
  tk_call_without_enc('::Plotchart::polarCoordinates', @path, radmax)
  self
end

#polar_to_pixel(rad, phi) ⇒ Object



310
311
312
# File 'lib/tkextlib/tcllib/plotchart.rb', line 310

def polar_to_pixel(rad, phi)
  list(tk_call_without_enc('::Plotchart::polarToPixel', @path, rad, phi))
end

#save_plot(filename) ⇒ Object



166
167
168
169
# File 'lib/tkextlib/tcllib/plotchart.rb', line 166

def save_plot(filename)
  tk_call_without_enc(@chart, 'saveplot', filename)
  self
end

#set_zoom_panObject



323
324
325
326
# File 'lib/tkextlib/tcllib/plotchart.rb', line 323

def set_zoom_pan()
  tk_call_without_enc('::Plotchart::setZoomPan', @path)
  self
end

#title(str) ⇒ Object



161
162
163
164
# File 'lib/tkextlib/tcllib/plotchart.rb', line 161

def title(str)
  tk_call_without_enc(@chart, 'title', _get_eval_enc_str(str))
  self
end

#view_port(*args) ⇒ Object

args := pxmin, pymin, pxmax, pymax



274
275
276
277
# File 'lib/tkextlib/tcllib/plotchart.rb', line 274

def view_port(*args) # args := pxmin, pymin, pxmax, pymax
  tk_call_without_enc('::Plotchart::viewPort', @path, *(args.flatten))
  self
end

#world_3D_coordinates(*args) ⇒ Object



285
286
287
288
289
290
# File 'lib/tkextlib/tcllib/plotchart.rb', line 285

def world_3D_coordinates(*args)
  # args := xmin, ymin, zmin, xmax, ymax, zmax
  tk_call_without_enc('::Plotchart::world3DCoordinates',
                      @path, *(args.flatten))
  self
end

#world_coordinates(*args) ⇒ Object

args := xmin, ymin, xmax, ymax



279
280
281
282
283
# File 'lib/tkextlib/tcllib/plotchart.rb', line 279

def world_coordinates(*args) # args := xmin, ymin, xmax, ymax
  tk_call_without_enc('::Plotchart::worldCoordinates',
                      @path, *(args.flatten))
  self
end

#xconfig(key, value = None) ⇒ Object



181
182
183
184
185
186
187
188
# File 'lib/tkextlib/tcllib/plotchart.rb', line 181

def xconfig(key, value=None)
  if key.kind_of?(Hash)
    tk_call_without_enc(@chart, 'xconfig', *hash_kv(key, true))
  else
    tk_call(@chart, 'xconfig', "-#{key}",value)
  end
  self
end

#xtext(str) ⇒ Object



171
172
173
174
# File 'lib/tkextlib/tcllib/plotchart.rb', line 171

def xtext(str)
  tk_call_without_enc(@chart, 'xtext', _get_eval_enc_str(str))
  self
end

#xticklines(color = None) ⇒ Object



205
206
207
208
# File 'lib/tkextlib/tcllib/plotchart.rb', line 205

def xticklines(color=None)
  tk_call(@chart, 'xticklines', color)
  self
end

#yconfig(key, value = None) ⇒ Object



190
191
192
193
194
195
196
197
# File 'lib/tkextlib/tcllib/plotchart.rb', line 190

def yconfig(key, value=None)
  if key.kind_of?(Hash)
    tk_call_without_enc(@chart, 'yconfig', *hash_kv(key, true))
  else
    tk_call(@chart, 'yconfig', "-#{key}", value)
  end
  self
end

#ytext(str) ⇒ Object



176
177
178
179
# File 'lib/tkextlib/tcllib/plotchart.rb', line 176

def ytext(str)
  tk_call_without_enc(@chart, 'ytext', _get_eval_enc_str(str))
  self
end

#yticklines(color = None) ⇒ Object



210
211
212
213
# File 'lib/tkextlib/tcllib/plotchart.rb', line 210

def yticklines(color=None)
  tk_call(@chart, 'yticklines', color)
  self
end